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

Problems creating spell rpg

$
0
0
Hello I'm trying to create spell prefab with Rigidbody without gravity and BoxCollider with trigger and call it when I press a key, so far so good; The problem starts when in the MonsterDetectCollisions class I try to subtract life points from the creature by implementing the Trigger method because the enemy subtracts 5 by 5 every millisecond and obviously destroys it when I only want to subtract it once, not constantly every millisecond. private void OnTriggerEnter(Collider other){ if (other.CompareTag("Spell/Sorcerer")) { gameObject.GetComponent().TakeDamage(5); } } Does anyone know how I can fix this? I've been hours and I'm desperate Please!

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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