- Home /
Question by
GarmashKirill · Aug 31, 2020 at 10:32 PM ·
2d animation
2d animation should start in different positions
Hello everyone. I am totally new in unity and can't find anywhere answer on my question. I have GameObject "star" with animator in it. I want to create 50 stars, for example, and animation of each one shoud start in a different position of animation, that they could blink in a different way.
PS:Please tell me how to check if the animation is over.
public GameObject star; public int numberOfStars; void Start() { for(int i = 0; i < numberOfStars; i++) { Instantiate(star, new Vector3(Random.Range(-750, 750) * 0.01f, Random.Range(-200, 400) * 0.01f, -0.3f), Quaternion.identity); } }
Comment
Your answer
Follow this Question
Related Questions
Basic Movement on 2D (C#) 1 Answer
The sprite editor won't let me slice 7 Answers
Problem with Scrip for sprites 1 Answer
2d Animation and Colliders 0 Answers