Search Unity

Question Prefab is being triggered by animation whoever is not showing visually

Discussion in 'Animation' started by n7pankake, Feb 22, 2023.

  1. n7pankake

    n7pankake

    Joined:
    Nov 18, 2017
    Posts:
    19
    So my player has some animations that trigger a prefab to show up according to certain animations such as jump, landing and running quite basic and they used to show visually before but I modify my movement script to give my game more personality, the thing is before that my landing/jump/running prefab would show up but it doesn't show anymore but I can see them in the Hierarchy when the game is running and they appear at the right time.

    So this are the 3 effects player should show:



    and in the code this are the (ignore footstep) three calls for the animations:



    they should be triggered on each animation and they are here are each animation and their respective trigger.

    This are the 3 prefabs with their scripts and animations:





    the player animations have their event that they will call the method from the script before which should bring up the prefab



    and right after that then the animation of each prefab have the destroy method when they finish animation (I can't upload more images but eee is basically the same than above BUT for destroying the prefab at the very end)

    I'm trying to understand why it doesn't work I changed the code but not to affect that directly and I do not understand why it doesn't show up when is showing while the game is running and the player is doing the animations that should bring up those prefabs.