- Edited
Loop Start End to Unity
Hi, and thanks for the help in advance.
I'd like to know if there's some way I can achieve this type of loop
Animation A][Animation B][Animation B][Animation B]
I know you can see this behavior using the loop start-end in the dopesheet but it can't be exported like that to work in Unity right? Is there a way to achieve this without having different Animations? and just using selected frames in the dopesheet?
did you want to call the following?
SetAnimation(0, animationA, false); // play animation A once
AddAnimation(0, animationB, true, 0f); // queue looping animation B.
You can also set the loop times on the TrackEntry.
Pharan wrotedid you want to call the following?
SetAnimation(0, animationA, false); // play animation A once AddAnimation(0, animationB, true, 0f); // queue looping animation B.
I better rephrase, what I want to do is show this type of loop
Animation 1
Frames 1-30 (once) / Frames 31-60 (looped indefinitely)
float fps = 30;
TrackEntry start = SetAnimation(0, animation, false);
start.animationEnd = 30 / fps;
TrackEntry repeat = AddAnimation(0, animation, true, 0f);
repeat.AnimationStart = 31 / fps;
repeat.AnimationEnd = 60 / fps;
See TrackEntry animationStart
and TrackEntry animationEnd
. If 60 is the last frame of the animation, you don't need to set AnimationEnd
for repeat
.
Nate wrotefloat fps = 30; TrackEntry start = SetAnimation(0, animation, false); start.animationEnd = 30 / fps; TrackEntry repeat = AddAnimation(0, animation, true, 0f); repeat.AnimationStart = 31 / fps; repeat.AnimationEnd = 60 / fps;
See TrackEntry
animationStart
and TrackEntryanimationEnd
. If 60 is the last frame of the animation, you don't need to setAnimationEnd
forrepeat
.
Thanks a lot Nate. I really have to start taking a look at Unity to help my devs out