Quantcast
Channel: Questions in topic: "die"
Viewing all articles
Browse latest Browse all 115

When I run game in device player velocity cannot zero when die in unity

$
0
0
In my unity2D game run in device so player velocity set not zero when collide with ground. void OnCollisionEnter2D(Collision2D target) { if (target.gameObject.tag=="Ground"){ die(); } } void die() { if (isAlive) { isAlive = false; anim.Play ("BirdDied"); myRigidbody.velocity = Vector2.zero; playGameVolume.PlayOneShot (diedClip); } }

Viewing all articles
Browse latest Browse all 115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>