Hello, I’m having an issue with colliding. I’m in the early stages getting the collision set up and I’m just running debug logs to see if it’s working at all, and sadly it’s not.
All I’m doing is checking to see if it collided with “Cube” but I think I’m overlooking something.
I’ve googled much and read a lot of answers/forums so I’m not sure what it is.
Also, documentation here says “Note that collision events are only sent if one of the colliders also has a non-kinematic rigid body attached.” which I have attached to my Player game object. Unity - Scripting API: MonoBehaviour.OnCollisionEnter(Collision)
This is the code I am using
void OnCollisionEnter(Collision collision) {
Debug.Log("Collided");
if (collision.gameObject.tag == "Cube"){
Debug.Log("Collided with cube");
}
}
Thanks and sorry if this has been answered I’m not sure what the issue is.
Note I have the tag of the cube set for “Cube” and the player tag is “Player”
This may probably sound very stupid but I must ask you…Did you give both objects a collider? (this assuming you did give the rigidbody to the player and left isKinematic unchecked as you said). Also, how are you moving your object?
Yeah they both have a collider, I’ll screen my settings and show you.
I’m not really sure what you’re asking on how I’m moving it (I didn’t actually write the movement script, I had some help from someone.) (Also, this is a space ship, I press play and it moves forward at a set speed.)
http://puu.sh/2ystT Ship
http://puu.sh/2ysvh Cube
isTrigger is for OnTrigger functions. OnCollision functions don’t use isTrigger. Are you using Translate to move the ship?
Oh, it worked! I suppose I had one of the triggers set to “true” when I thought I had them both off as I was starting to click things to make sure.
I’ll probably use trigger anyway though as I don’t want the ship to stop when it hits some things. Thanks for your help and I’m sorry I wasted your time for being so silly. 
It’s alright. If you have any problems, feel free to drop me a message or post it in the forums =)