Godot Engine

Godot Engine

Sersch Nov 13, 2019 @ 3:31am
Areas don't detect Trimesh Static Bodies - any workaround?
I'm currently working on a First Person Shooter. I'm creating projectiles with an Area node as the Scene Root. This works well, as long as my projectiles are colliding with objects that use default collision primitives (cube, capsule and so on) or Convex Static Bodies.

I can't get the collision working with Trimesh Static Bodies though. Here's an issue from February 2018 describing the problem https://github.com/godotengine/godot/issues/16392 and a fix from September 2018 https://github.com/godotengine/godot/pull/21774 but this still seems to be not working.

Is there any other way to create working projectiles? I tried using KinematicBodies instead, but they block a player's movement as soon as they impact (which was to be expected due to the way KinematicBodies work).

Last edited by Sersch; Nov 13, 2019 @ 4:05am
< >
Showing 1-2 of 2 comments
Baroon Valm Nov 13, 2019 @ 11:29am 
1) use Rigid Body with waay higher mass then the bullets
2) Area's don't work on trimesh bodies because a Trimesh body is only the outer layer, doesn't include the volume of what is inside the trimesh body (like a trimesh sphere for example, you could move inside it and outside of it but you'd hit walls when you get to the sphere's edge where you are touching it)
3) make the projectiles Areas and not Kinematic, which will prevent the player from being stopped, and will pass through but the area should register entering, which you can use to remove the bullet and tell the body you collided with to get hurt
Sersch Nov 14, 2019 @ 3:40am 
Thanks a lot! I don't think that's what you meant, but I tried using RigidBodies for the bullets and now everything works well. They can detect the player as well as mobs who both are Kinematic and they can collide with convex shapes and trimesh collisions.
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Nov 13, 2019 @ 3:31am
Posts: 2