Detaching child from parent when it collides with another object?
i have an F1 type car an i want to detach an object e.g part of the front wing from the body of the car when it hits an object like a cube or another car. i have box colliders on all of the objects except the wheels because i have wheel colliders on them. i know how to detach a child trough script but i dont know how to detach it when collided with an object.
Answer by ElementalVenom · Aug 09, 2016 at 08:43 PM
do something like OnCollosionEnter() to detect collisions and once you collide do transform.Parent=null on the child to break it from the parent.
Your answer
Follow this Question
Related Questions
error CS0120: An object reference is required to access non-static member `ScoreManager.score' 1 Answer
How to make an enemy 2d chasing player? 1 Answer
Wrong after Update? 0 Answers
warning CS0618 with unity ngui 0 Answers
Same Q as before but it has been a while and nones replyed so im reposting 2 Answers