Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

normalisedTime troubles

$
0
0
Hi there, i m french so excuse my english I have a character walking, but the animation is not continuous, so looping at it does it is also sliding, i want him to move only on the leg pushing frames of the walk cycle. to do so i m trying the `normalisedTime` action to reach certain frames of animation but as i am a very beginner, i mfirst trying things in an empty scene (instead of crashing the controller script i spend so many hours to wrote (with tuto for shur)). so in this try (as it is in my true scene) i have the character into a empty object and I wrote: var figurine:GameObject; //to bring in the animated gameObject function Start () { var idle= figurine.animation["idle"]; idle.wrapMode=WrapMode.Default; // with default it works } function message (){ figurine.animation.Play("idle"); if(figurine.animation["idle"].normalizedTime <0.5){ print("first_part");} if(figurine.animation["idle"].normalizedTime>0.5){ print("second_part");}} function FixedUpdate(){ message();} so with the WrapMode set on Default it works well: I have the messages :"first_part,second_part,first_part_second_part etc.... but if i change WrapMode into: idle.wrapMode=WrapMode.Loop; it does not alternate, it clamps as so: First_part,Second_part,Second_part,Second_part,Second_part,Second_part, etc.... Could some one light me with this? Thank you very much. greetings from france.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>