HI, I am trying the animation component out and I have my animation set up and code to change the parameter of it, but nothing seems to happen. If I run the game and click the parameter in the animator tab, the animation changes, but when I run the game, and attempt to do the actions that should make the animation run, it doesnt work.
This is the code and a image of the animation set up, if someone could possibly help me out. thanks
First, avoid GameObject.find calls. There are better ways to do it such as adding a public gameObject to your script and dropping the camera in there. For this case it isn’t as big as deal since you are calling it once but it’s good coding habit to avoid.
Your animation setup looks correct from what I can tell. The culprit may be the Health int. How are you retrieving Health and have you done a Debug.Log(Health) to make sure Health <=0? I would start there first.
Hey, The health is working fine, i checked that part out. Could it be because the the object that the animation relates to is being instantiated after the scene starts, and is not in the game to start?
As long as you are setting demondeath bool true after it is instantiated then no that is not the problem. If however it isn’t instantiated prior to setting the bool to true then yes that is your problem since your default setting is false. Is the script attached to the instantiated object? I would assume yes since I don’t see a getcomponent call.