Body type for an object a KinematicBody "rides" on?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tato64

Hello! Long story short i was making a kind of multiplayer “Raft wars” game (3D FPS).

Player characters are KinematicBody and i made the rafts as a KinematicBody too, in general this works perfectly. The player can move freely on the raft even as the raft itself moves, and wont slide off (as long as the raft doesnt move too fast, which it doesnt) and i made it so the player can look at the engine and interact with it to move_and_slide the raft, which also works as intended.

Problem is, i get a ton of FPS issues when, for example, a raft collides with another raft or “pushes against” it. (The other raft of course wont move because it is a KinematicBody, i dont intend for it to move either, and im sure

This made me wonder if there’s a better node type (or method) to make a body that moves and “carries” a player standing on it. (And the player can also move on it)

Or should i just code something that “stops” a KinematicBody when it is colliding with another?

Thanks in advance!

:bust_in_silhouette: Reply From: Lopy

KinematicBody seem to already b the best CollisionObject for your usecase. There is also RigidBody (more complicated/laggy) and StaticBody (not meant to be moved).

You could add Areas around your rafts to detect when they are near one another and push them apart manually.
Also, you can use collision masks to make rafts not collide with one another.

Finally, you might also be able to gain performances by making the rafts’ CollisionShape simpler.