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

can't detect what player collides with, tried everything and all other posts...

$
0
0
so i want to make a 2d game where when player collides with spike it triggers something (for now i want debug.log to trigger just to be sure) void OnCollisionEnter2D(Collision2D trig) { if (trig.gameObject.tag == "Enemy") { Debug.Log("player touches enemy"); } well if it shows the code bad sorry. so, i am trying to detect the tag of the Enemy (spike) and make a trigger. after that i will put a die script.

Viewing all articles
Browse latest Browse all 1488

Latest Images

Trending Articles



Latest Images

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