one shot animation clip

cansub 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 3

I have legacy animations for a pistol and I've added the animation set and play upon left mouse button down.  It does play the animation but it keeps looping it.  I added a stop animation but it stops it immediately - i.e. it doesn't even play.  How can I ensure that the animation plays though only once each time the left mouse button is depressed?  If they were generic animations it would have been very simple using an animator...Is there a function to add a time delay between flow states?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Strange, animations should only play once.  You said it's legacy, is play automatically turned off?  Is the wrap mode setup correctly?  Do you have any other systems playing the animation, perhaps in an update loop?

"Down" should only trigger once per press.  Maybe try attaching a debug.log unit to it and see if it is spamming the console to rule out a bug.

If you want to make sure that it goes through one entire uninterrupted loop on key press, using legacy, you could do something like:

You should not need anything from bolt to alter it. Just check the animation itself in the inspector and mark it not to loop.