I have discussed this issue earlier but, now this has grown much more difficult. I tried to make the code short and simple by using string variables, but the animations don’t work. They worked fine earlier.
PlayerState is to check whether the player is transformed or not, PlayerAct is to check whether the player is active or idle and directions is for in which direction the player is moving: Up, Down, Left, Right
Credits to ZeroX4 for helping out earlier
You seem to be building the name of the animation. Make sure all of the variable names match each part of your animation names including capitalization and order. I frequently mess up the upper and lower cases.
I’m guessing you’re using something like
UpActiveIdle
Another possibility is that I only see the animation being updated when an arrow key is pressed but not when PlayerAct or PlayerState are changed. I’m not clear on their uses but as is the animation would only change instantly if one of the arrow keys was also pressed. IDK if the animation needs to be updated after those variables are changed.
well, you got half of it correct and I checked twice the capitalization is correct, i think the reason is the space in between.
These are all the animations with their names. I can’t find any problem though.
Should I just use the change animation statement in a forever loop?
It would be the spaces, the names needs to match exactly. You can either remove the spaces or add them to the animation change action
Something like
Direction + " " + PlayersState + " " + PlayerAct
I tried removing the spaces, but the issue still remains, and i tried adding the double quotes and the animation still doesn’t work. The action is in a forever statement, so we don’t have to keep updating the animations with every input.
I just remembered that I hadn’t put the spaces in between the quotes but the problem still remains.
Are the variables all object variables ? It uses an object variable and 2 scene variables to set the animation. Make sure it’s consistent. You still need the spaces fix but I think the first and last variables are set as object variables but the last one is read as scene.
Yeah, I checked that, it works now. thanks for the guidance.
1 Like