animal sprite set in Start()
This commit is contained in:
parent
f01a969ddf
commit
f454e82aab
1 changed files with 2 additions and 0 deletions
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue