Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

How do I make my player re-spawn in its original place on collision of enemy?

$
0
0
How do I make my player re-spawn in its original place on collision of enemy? I have set this piece of code on to the enemy but my player is not respawning? Thanks in advance, Dil #pragma strict var Player:Transform; var spawn:Transform; function OnCollisionEnter(collision:Collision) { if(collision.gameObject.tag == "Player") { Destroy(collision.gameObject); } Player.transform.position = spawn.position; }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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