- Home /
mesh collider won't disable when using transform on his parent
It seems like a disabled collider isn't disabled animore when using a transform on there parent. This is what I do.
I've a scene in witch are 3 objects. two small ones are in one big object. All three of them are linked to the same empty object and have a collider. With a slider the alpha of the big one is changed. when the alpha <0.5 the collider of the big object is disabled.
To each of the 3 objects there is a tooltip script. When I hover over the big object, the tooltip shows the name of that object. When the alpha of the big object <0.5 and the collider is disabled, the tooltips shows the names of the 2 objects within that big object when hovering over them. I use a mesh collider and this works fine. But ...
..when I add a script to the empty object witch is the parent of all three, it doesn't work anymore. It seems like the collider of the big object is no longer disabled, althougt you can see in the inspector that he is. If I use a box collider all works fine but if I use a mesh collider it doesn't function anymore it keeps showing the name of the big object instead of the containing objects.
The script that I add to to parent is this:
function Update () {
var horiz : float = Input.GetAxis("Horizontal");
var vertic : float = Input.GetAxis("Vertical");
transform.Rotate(Vector3(0,horiz,0));
transform.Rotate(Vector3(vertic,0,0));
}
If I leave out the two last lines with transform all works fine but with the transform it won't.
Anyone any idea why.
Your answer
Follow this Question
Related Questions
For flat mesh, is there a performance difference between box vs mesh colliders? 1 Answer
Wich is faster? Mesh collider or lots of primitive colliders? 1 Answer
Can't go into building because of collider around it 1 Answer
Disabling or Destroying more lagless/ Do colliders and transforms work while disabled? 1 Answer
In need of an OnWillDisable() event 2 Answers