Newbie question: mesh import

I would like to add that mesh geometry, number of meshes, and arrangement of those meshes can determine if you should add collision checks for each child mesh.

Number of meshes obviously affects the performance, while the other two can lead to some issues, mostly resulting in camera/object getting stuck in some corner (…so many times xD)

What I usually like to do is to create collision objects separately. And I use only boxes to achieve that. here is an example of that:



So instead of setting collisions for each individual mesh I am creating box and wrapping the whole object. I usually load these collision boxes separately using AseetsManager, but you can keep it as part of your mesh. So in the code you just set this box to isVisible = false and checkCollisions = true.

It’s more stable, and more performant.

One more example are walls, floors, door spaces, all of those narrow corners can give you some issues, and you getting stuck inside. So what I do, is I analyze the scene and define where collisions should occur, then I just create boxes to act as “walls” or “barrier” in those places. So it would look something like this for a simple house-like object.

This is probably not necessary in every use case, if your objects are simple enough (like, if those are already box-shaped, sphere, or some other primitive) then there is probably no need to wrap them with separate objects.

3 Likes