Collisions with Blender exports

Went through the getting started tutorial and got everything to work there. But once I was done I tried exporting a basic cube from Blender as an fbx to test it out. It displays as expected, but I’m unable to get collisions to work.

Adding the “Mesh Collider” and “Static Physics” components, don’t work. It works with the assets provided for the starter game. It’s not clear what’s missing.

I’m using LY 1.15.0.0 and Blender 2.79b.

Any help would be amazing.

Thanks for the reply.

I didn’t have the CryPhysics Proxy modifier set on my cube, but it’s also not set for the meshes in the starter game (e.g., GSG_Maze_Doorway.fbx) and collisions work fine on those.

I did try setting the CryPhysics Proxy mod on my cube and setting the Physics meshes to include the cube, but that alone didn’t fix it.

I’m not sure what you mean by “collision model”. How does LY identify this model? I do see in the asset browser that GSG_Maze_Doorway.fbx does include a mesh labeled “physics_mesh”, but I tried renaming my cube mesh to match and still no dice, so I’m assuming there’s more to it than that.

I believe CryPhysics. I don’t have the PhysX gem installed. Just using stock Lumberyard.

@robert_sf

Are you using CryPhysics or PhysX? The setup for each is slightly different.

@robert_sf

Here are some things you can double check:

  • Does your mesh include a physics / collision model? When you use the Mesh Collider component, Lumberyard looks for this mesh to use for your collision.
  • The Static Mesh component should be used on meshes that do not need to move. Examples include unmovable objects, streets, sidewalks, walls, etc. If you need your mesh to move and collide with other objects, use the Rigid Body Physics component.
  • Check the FBX Settings. Right-click on your .fbx file in the Asset Browser and choose Edit Settings… and make certain that you have added the CryPhysics Proxy modifier.

I am not familiar with Blender. But here is the general concept:

  • In blender your asset will have two models: the render mesh and the collision mesh.
    • The render mesh is the one that you see in Lumberyard.
    • The collision mesh will be invisible and typically this model should be as simple as possible to describe the collision of your model. When objects in Lumberyard collide, they are actually colliding with the collision mesh.
    • For simple shapes, you can just duplicate your render mesh and use the duplicate as the collision mesh.
  • There are soft naming conventions that you can use so Lumberyard will automatically know what each mesh is:
  • Now in Lumberyard when you go to the FBX Settings… for your sphere you should see the CryPhysics Proxy modifier added automatically. Also, make certain that the mesh named sphere_phys is set for the collision. You should have something like this:

Your collision should be set up correctly now. Finally, add the Mesh Collider and Static Physics components to tie it all together.

Good luck!