Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug How can I use transforms on a mesh collider?

Discussion in 'Editor & General Support' started by NormyHaddad, Jun 18, 2023.

  1. NormyHaddad

    NormyHaddad

    Joined:
    Jan 10, 2022
    Posts:
    29
    I have a problem, I have models in my world that won't work well with the standard colliders like capsule or box, their shape is more complex. I can add mesh colliders to the child parts of the model but when i try moving those to the parent object (which i need to do because its much easier that way than having a raycast hit a child object and having the raycast get a reference of the parent object from the child object it hit), but the scale and rotation are off, so the hitbox doesn't match at all. Any way I can fix this?
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,596
    If the parent object has a Rigidbody, ALL of the collision events for that parent object and ALL of its children will go to the parent object, regardless of which child got hit. If you don't want the whole object behaving like a physics thing, just turn on isKinematic on the Rigidbody component.
     
    NormyHaddad likes this.