Hi, I’m facing a problem that I couldn’t find an answer to in the documentation and on google, the problem is the operation of collision in instances. On my scene there are meshes exported from blender and there are primitive boxes, collision on instances in primitive boxes works correctly, but on meshes from blender is not, by wrong work I mean the possibility to fall into the object and get stuck there and other strange behavior (at the same time if I copy this object everything works fine). I’m sorry but I can’t move everything to PG but here is a link to the repository Repo, files to study: main.ts, DungeonGenerator.ts.
Looks like the collision is not enabled on the original mesh. Though, I’m not sure I fully understand the issue from just your writing. Ideally, you would disable the original mesh when working with instances.
Else, you need to make sure your original mesh also checks for collisions. You can make sure through the inspector. The other thing I’m unable to figure here with just this extract of your script, but might be of importance, is that collision occurs only on the front side of mesh/normals. You should check on that too.
collision is enabled for source mesh as you can see and i enabled it for each instance,
also i have disabled all occlusion for test but issue still here.
Nice dungeon, by the way
When I put this snippet into your code:
scene.meshes.forEach((element: Mesh) => {
if (!element.checkCollisions) {
console.log(element.name);
}
});
I’ve got the next results:
Check if those meshes (which have checkCollisions = false) are responsible for falling down.
As for camera stuck my guess it is related to bounding boxes size but I need to check if that is true.
Is your barrel a single mesh or an assembly? Could it be that normals are inverted on your top mesh of barrel? Or that you inverted the z-axis if it is an instance? I think without a PG we can only make assumptions. The boundingBox thingy mentioned by @labris could also be relevant. Hard to say without a PG.
Sure, but you know I’m the lazy type not sure I have the time to dig into this
I have an hour left to take a shower and move myself to this dinner I’ve been invited to So I guess I will let you just take over… You’re better than me at it anyways
You were right all my headache because of inverted normals, by the way, there is strange behavior, the normals become inverted after creating an instance. Therefore, I create the source mesh with inverted normals like this: