Sunday, 15 April 2012

c# - How to set position of gameobject for animation in script -



c# - How to set position of gameobject for animation in script -

i have 2 game object. both gameobject positions different... attached same animation clip both gameobject.

in 1 game object don't want alter in animation clip. want utilize same animation clip on different gameobject animation timing different & in other gameobject want play animation @ 0.30 s not knowing how set position of gameobject in script.

i assign below script sec game object.

using unityengine; using system.collections; public class ani3 : monobehaviour { void start () { animation ["@cube"].time = 0.30f; //how set position of gameobjet } void update () { gameobject.animation.play("@cube"); } }

you can utilize empty game object , nest 1 of game object kid , alter position of empty game object ,it work me

c# animation unity3d

No comments:

Post a Comment