Hello again! This is now my third post regarding gravity controllers. I’ve been playing around with them on and off over the past two years. I’ve learned a lot and as a result have gone through a number of iterations that vastly improve the techniques used.
Now what I’m posting today is actually two separate controllers. They both have different use cases so please do read the whole post before deciding which one you’d like to use in your game or play with, etc.
Okay, so on with the show!
Wall stick controller
If you’ve seen my previous post(s) this controller will be familiar to you. The concept is that we have a de-rotated world transparent and way off in the distance that we traverse with a fake character. We then replicate that fake character’s movement over to our real character which gives the appearance of defying gravity and walking on walls and so forth.
Now, the largest change here from my previous iteration (aside from an overall cleanup and simplification of some math), is that we no longer use body movers. Originally the reason I chose to use body movers was because they replicate nicely. However, what body movers do not do nicely is move fast enough to keep up with the physics that affect parts and so forth. So now we use CFrames and we replicate our character movement ourselves.
This change allows for much greater accuracy when it comes to standing on any moving platform.
You can run around on moving objects that are either CFramed or being moved by a body movers:
You can stand on a plane with another character driving it:
Heck, you can even ride on a part that’s being flung across the map with physics
Now it does have a couple issues that I’m aware of, but they’re pretty minor.
- It’s not really well defined when the player falls off the map so sometimes you just get stuck and never die (unless you reset)
- The player can’t use seats while the controller is active. In the video above I disable the controller before sitting on it
- The .Touched event can be a little crazy when registering the character. I suppose technically because the character is being cframed sometimes this can cause repeat firing or no firing at all.
- The popper cam isn’t quite perfect. I’m kinda stumped on this one to be honest. It works pretty well, but especially when on moving platforms is kinda clips through walls a little bit. For now I’m blaming it on floating point error, but it’s probably not that .
- Probably the biggest one: It doesn’t work with terrain!
This controller is true to its name in that it controls gravity and that’s about it, it doesn’t have any of the other wacky physics abilities of the other controller, but it does handle certain things better such as the ability to walk on curved surfaces and yes, the ability to walk on terrain.
Now the main downside to this controller is that we lose all the benefits of humanoid state tracking. I added a very very simple state tracker for animation purposes, but it really only does the bare minimum.
Again, it does have some issues of its own:
- Again, if a player falls off the map you may end up falling forever
- The player can’t use seats when the controller is active
- As mentioned there’s no state tracking when using this controller.
Finally, I want to make two things very clear.
First, I have no intention to support these controllers going forward. If there’s a bug you’ll have to figure it out. If Roblox pushes an update that breaks these bad boys, guess who has to fix this sucker… you! If you send me a message regarding any of these problems I will not respond to it.
Secondly, and this is probably unsurprising, I don’t intend to make another iteration of these controllers. You’re more than welcome to build upon my work and share it (I’d certainly enjoy that), but I think I’m done with these. If I do make another iteration I don’t intend to release it.
That’s all folks.
Hope you enjoy and make some cool stuff with this! Cheers