X
X
xXx_Unity_xXx2021-12-30 17:51:11
Unity
xXx_Unity_xXx, 2021-12-30 17:51:11

How to play the death animation 1 time?

Hey Ya! I have the animator and player death set up. When he dies, the death animation is played, but it loops for 1-2 frames, for the 15 seconds I specified ... then the player is destroyed.
So, how to make the animation play exactly 1 time?
The animation itself is also 15 seconds long.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xXx_Unity_xXx, 2021-12-31
@xXx_Unity_xXx

In general, as always happens, I did it myself. The problem was in the boolean condition that was called every frame in the update, but for some reason I could not immediately fix this if with a second boolean change to activate the bool 1 time.
In general, I left the milf check, but changed the bool to a trigger and it all worked ..

K
KraGen.Developer, 2021-12-30
@KraGenDeveloper

Krch select your Animation and on the right in the inspector there will be Looping, uncheck it.

F
Farawa, 2021-12-30
@Farawa

Your problem is that apparently the animation is called from any state and apparently by the bool isdead trigger or something like that, make a flag in the script, is the animation called at least once and everything should be fine

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question