|
Hi there. i have some [fireBall] which have rigidbody and checked as Is Trigger. Then player have code like this: unction OnTriggerEnter( hit : Collider ) { if(hit.gameObject.tag == "respawnPoint") { dead = true; HealthControl.LIVES -= 1; } } everything is fine, just how should i do, that fireBall would collide on walls or terain? Becouse now fireBall is going through terain, walls, mountains, etc.. Thank you very much.
(comments are locked)
|
|
This is happening because you've set Is Trigger to true. It seems you need a trigger to detect "respawnPoint", but usually it's not a good thing the "enemyProjectile" to be a trigger. Uncheck Is Trigger in the FireBall object and detect it in OnCollisionEnter (or OnControllerColliiderHit, if the player is a Character Controller):
(comments are locked)
|
|
Yeah, firstly i used: OnControllerColliderHit( hit : ControllerColliderHit) but problem is If i want the code to work with OnControllerColliderHit (), i need to move with my playerCharacterController. If I stand still, when enemyProjectile hits player, nothing happens.
(comments are locked)
|
