- Home /
Zombie attack script animation help!
I'm trying to make a script so that when the zombies arms collide with the player it plays a 4 second long scripted "animation" where the zombies arms rotate in the x axis for 1 second and then in the -x axis for 3 seconds. I'd like the java script to be something like this:
on collision with gameobject tagged "player"
transform.Rotate(Vector3(0.3,0,0)); //this rotation should last for 1 second
wait till the 1 second has passed
transform.Rotate(Vector3(-0.1,0,0)); //this rotation should last for 3 seconds
when the 4 second "animation" has finished playing it can repeat itself
I'm new to scripting so any help wold be greatly appreciated thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613194057im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Animation script error 1 Answer
Main Menu Java Coding Help 1 Answer
Animation doesn't work 1 Answer
How can I animate a sprite sheet in Java 1 Answer
Can the animation editor create local rotational data? 3 Answers