Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

OnCollisionEnter2D not working?

$
0
0
Hello. I searched up OnCollisionEnter2D and used the code it was provided with. I modified the code into #pragma strict function OnCollisionEnter2D(coll: Collision2D) { if (coll.gameObject.tag == "Player") Destroy(gameObject); } However, when the object collides with the Player it doesn't do anything. What am I doing wrong? I am making the game in 2D. I am also very new to Scripting and game creation.

Viewing all articles
Browse latest Browse all 7934

Latest Images

Trending Articles



Latest Images

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