0 votes

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!

Godot version 3.2.2
in Engine by (298 points)

1 Answer

0 votes

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.

by (2,478 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.