- Home /
Collision not detecting between two instantiated objects
I have a small system designed that spawns prefab rooms on a random node attached to them. The nodes keep getting spawned on after due to the number generator picking the same number again - my idea is to use OnCollisionEnter or OnCollisionStay to roll another node and move the room to that position, but the collision is never detected.
I have all of the prefab's nodes with a rigidbody and a boxcollider, with the kinematics enabled on the rigidbodies.
Blackthornprod on youtube look up level generation, it will help with your issue.
Answer by Llama_w_2Ls · Jul 11, 2021 at 10:37 AM
with the kinematics enabled on the rigidbodies
If IsKinematic
is set to false, are you now detecting collisions? In the project settings -> Physics, you can specify whether physics collisions are ignored for kinematic rigidbodies. Maybe that setting is on.
Also, if you're using OnCollisionEnter, are the colliders trigger colliders? If so, you should be using OnTriggerEnter.
Finally, (I made this mistake once), are you using 2D components? (e.g. rigidbody2D, boxcollider2D). If so, you should be using OnCollisionEnter2D
. This is unlikely from the information you gave, but I'm just putting this out there.
Your answer

Follow this Question
Related Questions
Triggering sounds on collision?,Rigged Character animation collision 2 Answers
BoxCollider get stuck when dragging over the border of two BoxColliders 1 Answer
2D Colliders aren't actually touching but they're behaving like they do? 0 Answers
Finding number of bowling pins knocked over 1 Answer
Is it safe to animate collision boxes? 3 Answers