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

Collider's codes works, while dont colliding..

$
0
0
Hey friends, i have a triggerenter2d code like; when triggerenter2d, hp -=10... But i try fire to empty space, target and the projectile didnt touch eacy other, didnt collide, didnt triggered but target's hp is dropped. Are anybody have an idea about this? private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Enemy") { Destroy(gameObject); //destroys the projectile enemy1.hp -= 5 + (UnityEngine.Random.Range(player.dmg * 7/10, player.dmg)); } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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