How should I make a custom character controller?

Can’t really explain context, but I feel somewhat limited in terms of physics control with the default character controller and I’d like to make my own. I still want to make use of the default rig and everything but want to write a custom controller for it. I have absolutely no experience with this so my main questions (as stupid as they seem) are:

  1. How should I override/disable the default controls
  2. How do I make the movement server side while making it smooth on the client?
  3. Are there any specific functions I can use to move the character properly without the original controls? (Manually setting CFrame seems like it would have its limitations)
6 Likes

Sorry for the bump but I would like answers on this XD

I would recommend the new character physics controllers. I haven’t used them yet personally, but they were added for this purpose.

You don’t. Server sided movement would be delayed by at least the players ping, which wouldn’t feel good to the player. You want to leverage Roblox’s distributed physics system to make physics updates on the controlling client, and let the engine propagate them across the network.

Manually setting the CFrame is the most precise way to update the player’s transform, but that isn’t using physics. With the new controllers you’d assign to the MovingDirection and FacingDirection properties.

1 Like

I’ll try messing with those, thanks!

Sorry, I worded it weirdly. I was mainly asking if there’s a way to have movement work client side while being smoothly “validated” by the server (sorta like what this post describes)

So it depends on the use case, that makes sense! Thanks

1 Like

Well you already know what you need to do here, so it becomes a matter of implementation. A developer from Psyonix gave a great GDC talk about the physics behind Rocket League. The 2nd half of the talk was all about networking the player physics. They opted for an input buffer, which is a pretty standard approach used by most networked controllers. Here’s a timestamped link to that portion of the talk.

This is often called “Rollback networking”, which might have been a term coined by the guy who programmed Quake. There’s an open source Roblox system that implements this entirely in Lua, but it’s not production ready. They do have some good information on their readme though.

1 Like

Crazy freaking helpful, thank you so much. I think I have this figured out but I’ll reply if I have any more issues.

2 Likes