Hello! I want to add collision to my meshInstances in my object in order to execute “something” when they hit a trigger. Is this possible?
I have found out how to add collision and triggers to the object, but they affect all meshInstances as a whole, which is not optimal as I want to change them individually when passing through a trigger.
Do the individual meshInstances animate? If not, you can create multiple trigger/physics objects that are attached to the entity as children and fire an event to the parent when ‘triggered’.
If they do animate, than I would look at doing something similar but updating the position and rotation of the trigger/physics objects to each meshInstance every frame. It’s a bit trickier but still doable.
Mesh colliders are pretty expensive, you’d probably be better off using primitives to simulate your mesh.
Also you can use code to parent a collider to a submesh (meshInstance) if you graph that meshInstance’s “node” and use it as the parent. Best way to do that is with something that has a model on it to start with so you can see what is happening. Like a box with a box collider and a box model.
You could clone some entities to use as prefabs for instance, boxes, capsules etc. Or you could use all boxes and just scale them correctly.