From f454e82aab29eb911081b442e909e3c697545266 Mon Sep 17 00:00:00 2001 From: d-hain Date: Fri, 10 Jun 2022 15:50:39 +0200 Subject: [PATCH] animal sprite set in Start() --- Assets/Scripts/Animal.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/Scripts/Animal.cs b/Assets/Scripts/Animal.cs index 88a7539..d07c8db 100644 --- a/Assets/Scripts/Animal.cs +++ b/Assets/Scripts/Animal.cs @@ -11,6 +11,8 @@ public class Animal : MonoBehaviour { private void Start() { _rigidbody = gameObject.GetComponent(); + animalSprite = gameObject.GetComponent().GetComponent(); + _rigidbody.velocity = new Vector2(Random.Range(1, 10), Random.Range(1, 10)); }