Is it better to use BodyVelocity or CFrame?

Sooo,
The title is a bit off the actual question but I didn’t know how to explain it while keeping it short.
The clear problem is that I want to make a motorcycle.
But to get the movement right I would need to update the Velocity rapidly. (Otherwise it would just drive in one axis direction)
I already had an solution with CFrame by setting it every Frame but the code became too messy and complicated so I started new with better knowledge. Also the turning was shaky because I want that the cycle has so called “roll” when turning.
I decided to try BodyVelocity because it was easier to use…
and now the question:
Should I stay with CFrame for turning and driving or is it ok to use Bodymovers for this?
If it is ok, can I update BodyVelocity every frame or which method is the best?

Thanks in advance ^^

Using physics is always smoother because it updates 240 times a second. Using CFrame you can only achieve 60Hz.

1 Like

Use what works for you
60 hz and 240 hz isn’t always noticeable if you do it correctly, but it’s still only 60 hz and objectively “slower”
Whether that matters depends on how you use it
CFrame could be more buggy with the collision of stuff and requires a lot more manual labor to do the same thing physics could do automatically
Physics can cause bugs with collisions too, and you have less control over exactly what you want and how much that matters again depends
They both have very long lists of benefits and disbenefits and you could sit here all day deciding between the two, but just choose what makes the most sense for your workflow and game

Body Velocity Is Better Cause It Works Like A Cannon It Shoots Projectiles Meanwhile CFrame Can’t

Ok, then I think i will use BodyMovers.
But which is the best method Update the direction of the Velocity?
Like can I use RenderStepped or Heartbeat or something else?

(This question is to every answer but idk if you get notified if I answer to the post)

To optimize the performance and reliability of the server-client interaction for in-game movement and collision detection, it is recommended for linear velocity to be applied on both server and client sides. This ensures smooth and consistent movement experiences for players.

Additionally, to maintain efficiency and responsiveness, a hidden hitbox should be created on the server for detection purposes, while the visual representation remains on the client side. This approach prevents server overload and potential choppiness by reducing the workload on the server.

It is crucial to manage hitbox and damage calculations on the server side, and to avoid granting network ownership of the server hitbox to any player. Utilize overlap parameters for hitbox detection on the server to maintain accurate gameplay interactions.

Lastly, to facilitate seamless integration of visual effects, develop a library of modules that can be called upon using a remote event. This allows for easy creation of effects on the client side and streamlines the process of requesting these effects from the server.

Here is a simplified list of steps to optimize server-client interactions, explained in a way that is accessible for beginners:

1. Apply linear velocity: Use this body movement method on both server and client sides to ensure smooth movement and other benefits.

2. Create a hidden hitbox on the server: This allows for server hitbox detection without overloading the server with unnecessary effects.

3. Keep visual representation on client: By doing this, you avoid server overload and potential choppiness in the gameplay.

4. Handle hitbox and damage on server: Ensures consistent and accurate gameplay interactions for all players.

5. Avoid granting server hitbox ownership: Prevents individual players from controlling or manipulating the server hitbox.

6. Use overlap parameters: Implement these on the server for precise hitbox detection.

7. Develop a library of modules on the client: Create a collection of modules that can be called using a remote event for easy visual effects integration.

1 Like