- Home /
Question by
artwen · Nov 27, 2017 at 05:18 PM ·
animationanimationclipsamplesampling
How to use AnimationClip.SampleAnimation()?
I have a simple cube jumping animation clip, how do I use AnimationClip.SampleAnimation() to fetch say the cube's position.y in the first frame of the clip?
I tried jumpClip.SampleAnimation(someGameObject, 0f), while referencing someGameObject either to the source gameobject (the cube), or the target gameobject (a new gameobject), but with no luck, nothing happened.
Did I miss something?
Comment
BTW, I checked this guy's solution: https://answers.unity.com/questions/1284092/getting-the-position-of-an-object-in-an-animationc.html?childToView=1284584#answer-1284584
but still cannot get it to work.
Your answer
Follow this Question
Related Questions
Problems sampling animation in editor 0 Answers
AnimClip Curve to Animator parameter 0 Answers
Moving Player only during part of an animation 1 Answer