|
I'm trying to do a very basic thing, have my turret not collide with the missiles it's launching. Missile is a prefab reference.
The "Ball" child object is what the collider that's causing problems is actually attached to. There is another collider on the main GameObject but it's a trigger and used for activating the firing of the turret. Could having two colliders on different parts of a prefab hierarchy be causing issues? I've tried everything I can think of, even adding this to my Missile's behavior.
But the instantiated missile is still effected by the box collider. Of course, turning that collider into a trigger makes everything work fine, no more collisions, but then that breaks everything else. Any ideas?
(comments are locked)
|
|
The problem may be that if any objects have 'rigidbody' components, a rigidbody will use all the colliders (excep mesh colliders) on any of its child objects together as a single "compond collider". That is, unless the child object also has a rigidbody component, in which case the rigidbodies act as independently moving objects even though they have a parent-child relationship in the hierarchy. So it could be that wherever your rigidbody component is (if you have one), it's greedily assuming that all child colliders should belong to it, and that may be causing confusion about which colliders should be ignored - or something like that! Perhaps you could solve your problem by restructuring your hierarchy so that there's a separate gameobject with the trigger collider used for activating the firing, and make that entirely separate from the turret itself in the hierarchy. Interesting, I didn't know a compound collider grabbed all the child colliders, good to know! Unfortunately there's no rigidbody on any part of my turret. I will try the separate GameObject with the non-trigger collider to see if I can get IgnoreColliders to function with that configuration.
Jan 27 '10 at 07:28 PM
dkoontz
Setting the child objects to have mesh colliders did resolve my problem.
Jan 31 '10 at 09:32 AM
dkoontz
(comments are locked)
|
