Question by
panda1v1 · Sep 21, 2016 at 12:58 PM ·
collision detectionparenting
Collision Detection Problems
Hello fellow developers.
My game consists of a base building mechanic i am trying to code however is proving difficult to do. I wish to 'snap' the foundations together through the use of collisions. I have done this by making a 'Snap Block' which has a collider on it. When i instantiate the new foundation i have it check it's collision tag through the use of:
OnCollisionEnter (col : Collision) {
if (col.gameObject.tag == "SnapObject") {
//Some code to teleport the foundation to the snap block and freeze its position.. (it works ive tested it)
}
}
This works perfectly fine until i child the 'Snap Block' to the foundation. Can anyone tell me why this happening and possibly how i could fix it?
Comment
Your answer
Follow this Question
Related Questions
Temporary parenting for physics-driven objects? 0 Answers
cube stacking while parented 0 Answers
Infinite Loop? when Setting Parent 1 Answer
Missile Won't Attach as a Child of an Airplane. Why? 1 Answer
2D collision not work 1 Answer