- Home /
Script Help 3D touch animation
I have a Maya 3d door animation, imported to Unity, How can i create a script, for when I touch the door, the animation play from frame 0 to 20, or just play once, them when the door is touch again, the animation play back, and so on.
thanks...
Comment
Answer by DajBuzi · Feb 10, 2014 at 12:42 PM
_openDoorAnim.WrapMode = WrapMode.Once:
void OnTriggerEnter(Collision col){
OpenDoor();
Animation.Play(_openDoorAnim.name);
//Animation.CrossFade(_openDoorAnim.name);
}
For more detailed information ceck : https://docs.unity3d.com/Documentation/ScriptReference/Animation.html
Your answer
Follow this Question
Related Questions
Button Help 1 Answer
change to glow texture on mouse click 0 Answers
Unity isn't recognizing Maya 2010 .mb file? 5 Answers
A node in a childnode? 1 Answer
Script help!!! 1 Answer