|
Enemy script
Player Script
I used these both scripts, one on the cube and one on my player. But when the cube collides with my player, nothing special happens, it just walks past my player like nothing happened. What should i do? Does the problem lie on.... that's the problem... i don't know what should be taken care off. PLZ help cause i'm.... lost and noob..
(comments are locked)
|
|
Hi, Before you worry about the Messaging , you need to verify that the collision is happening. -Does your Cube have a rigidbody attached to it? -You need to know what are you colliding with. --create a tag and add the tag to the Cube (I am using enemy in the example below) I added this to the player: function OnCollisionEnter (col : Collision) { if(col.gameObject.tag=="enemy"){ Debug.Log("Collision Happened"); } } If collision Happens then you need to deal with the rest
(comments are locked)
|
