animal sprite set in Start()

This commit is contained in:
d-hain 2022-06-10 15:50:39 +02:00
parent f01a969ddf
commit f454e82aab

View file

@ -11,6 +11,8 @@ public class Animal : MonoBehaviour {
private void Start() { private void Start() {
_rigidbody = gameObject.GetComponent<Rigidbody2D>(); _rigidbody = gameObject.GetComponent<Rigidbody2D>();
animalSprite = gameObject.GetComponent<SpriteRenderer>().GetComponent<Sprite>();
_rigidbody.velocity = new Vector2(Random.Range(1, 10), _rigidbody.velocity = new Vector2(Random.Range(1, 10),
Random.Range(1, 10)); Random.Range(1, 10));
} }