Using rigidbodies with diffrent types

Is it possible that rigidbodies with diffrent types interact with each other?

  • The player entity has an kinematic rigidbody.
  • Interactable entities have a dynamic rigidbody.
  • Other entities have a static rigidbody.

Right now interactable entities are glitching a bit inside other entities.

I’m not sure about the player’s rigidbody being kinematic, because gravity, nor collision happens when it’s kinematic unless you do some custom code. I don’t see why interactable entities can’t be dynamic. And most entities that aren’t interactable should stay static.

Yes the player is definitely the problem, but I thought maybe I can set everything so that the glitching is limited. Only I have no idea which settings I should and shouldn’t adjust.

I’m not sure how to reduce the glitching myself, but I’m a bit curious on why the player is a kinematic rigidbody, rather then a dynamic one.

Because I move the player with script and without gravity.

with script meaning by setting it’s position directly or using translate?

For example:

this.entity.translateLocal(0, 0, -2 * dt);

Why not try using a dynamic rigidbody. You can set the gravity to 0 in the settings.

My collider with rigidbody is a child of the player that I move with script.
When I set the rigidbody to dynamic it is not moving when I move the player.

I think I’m not understanding. Can you send a screenshot of what you mean?

What I mean is that I think that a dynamic rigidbody is not effected by translateLocal of the script.
And with this.entity.applyForce(0, 0, -1 * dt) on a dynamic rigidbody also nothing happend.

to move a player with rigid body, you should use teleport instead of using translateLocal.

Also you can use this table reference to know what type of events are called on different rigidbody collision

Also, I don’t think -1 would work on applyForce. You need more force. Or you could directly set the linearVelocity to a new Vec3.

I skip this problem for now, because the techniques I currently use in my game counteract it all.

Thanks anyway!

1 Like