Attaching 'custom' colliders to objects

Hi all

I’m using an Asset store asset to create a highlight around an object when the mouse hovers over it.

  • currently I’m using a mesh collider to allow this to happen, however I’m concerned about the performance overhead of using this on a large number of objects.

  • so I’d like to switch to using a primitive, however when I add a primitive via the add component function the primitive it adds cannot be rotated (you can reposition / resize it via the inspector though)

  • what I’d like to do is create a cube gameobject, remove the mesh renderer component and reshape/resize/reposition in the GUI and then use this as the collider for the object like so.
    1801583--114853--custom.JPG

I’ve tried childing this to the object of interest but this wasn’t working.

Is this possible?

Thanks in advance

Having one or multiple primitive collide as children is known as comportment collide and is the correct way to tackle this problem.
What did not work as you tried it?

1 Like

Thanks fff. I imagine it is to do with the individual asset / script that I’m using, as it applies a glow to the object with a collider present on hover, however if the script is attached to the parent the collider doesnt register, and if the script is attached to the collider no glow is present as it has no mesh renderer. I’m waiting to hear back from the author if there’s a workaround.