Given the recent interest in being able to walk around on variously-oriented surfaces, I thought I’d make my system available to play with. This character controller has been in use in Club RAVEN’s Anti-Gravity lounge since the summer of 2017, so it’s not all state-of-the-art code, but I did update it recently to be Rthro-friendly. The code uses old BodyMovers because it predates AlignOrientation and VectorForce.
NOTICE: This is code extracted from a live game, being offered AS IS as an educational resource. I never intended this for distribution as an open-source library. You are free to try to use it in a game, but I cannot provide support or assistance in modding or incorporating it. This is why I’m not tagging it as Open Source, it’s source code I’m providing for educational value, it’s definitely not a drop-in system. There are a lot of quick-and-dirty hack fixes in this code that were required to keep it working through nearly 3 years of weekly Roblox udpates!
Features:
You can walk oriented to surface normals, with smooth transitions between adjacent surfaces:
Supports part Velocity and RotVelocity so that your character sticks to moving surfaces:
Supports smooth terrain:
Allows walking around edges, with physics interaction:
Ride Moving Parts:
Controller supports Desktop keyboard and mouse, mobile, and xbox. The ClassicCamera script and controller scripts have modifications to needed to keep the camera working as expected in the reference frame of the character, so they are forked copies.
Limitations:
This code is fairly old (I originally wrote the GravityDrive module during a weekend in May 2017 for a space station game I never finished).
Does not seem to work with current version of PopperCam (so camera clips through things). I fixed this in Club RAVEN, but apparently not in this test place :-/
The place contains forked PlayerScripts. There are modifications and additions to several of the camera and character controller classes.
Jumping is supported, as are the classic /e emotes, but not the recently-added Emote system, nor animation packs.
Seats are not supported, because of how jumping has been re-implemented
Character will not move along with parts that are moved by CFraming or Motor6Ds, or any other means that does not use Velocity and RotVelocity.
Comments are sparse, code is not clean, lots of stuff is commented out, debug code present, etc.
Absolutely! If you need anything explained, or want to chat about it some time, just let me know. I unfortunately don’t have the kind of free time I’d need to assist developers in integrating this into games, but you’ve given so much to this community, I’d be happy to take the time to answer any questions you have, or explain any of the myriad of hacks in this place
Okay I’ve been dreaming of the day I figure out how to achieve this effect, and had a sense that a game I’ve been playing has some sort of gravity effects going on for his vehicles (Base Wars by D8Dev), but oh my gosh the day is here! I’ve found your solution here, and this is GREAT!!! THANK YOU SO MUCH!!! I shall find this very educational and provide some great ideas … I’ll try applying AlignOrientation and VectorForce tech, a well.
My only small nitpick about it is that it lacks compatibility with other animations/character movement scripts. It can be modified, but the level of scripting used is almost alien to me. I’ll figure it out eventually. This controller is amazing though. Nice work.
Hi, I’m having problems with this Place on Mobile. When using the mobile thumbstick the character randomly changes direction. Steps to reproduce are as follows:
Follow the OP’s link to the Gravity Tensor World sample
Click the “Edit” in dropdown of Gravity Tensor World to open it in Roblox Studio
Click the little “mobile” icon in top right of Roblox Studio to switch to phone simulation
Press play icon in Studio to run the Place
Use the mobile thumbstick to walk up the walls of the large loop
Notice your character is unable to walk straight.
Observed: character randomly changes direction while walking up walls.
Expected: pushing straight up on mobile thumbstick should make character walk straight.
I’ve been digging around in all of these source files and so far I didn’t find anything specific to mobile thumbstick. So I’m not sure why this works fine on Desktop but not so well on mobile. Any help the community can provide, would be greatly appreciated!
This is a spectacular resource! However, I have been working with it for several days now, and I can’t figure out how to make it only work on terrain. This is for a planet system, so I only want players walking on terrain. I have tried to use the gravityboots remote events, but I just can’t figure it out. How does it work?
hi i know this topic is old, but how would i change the animation?
ive tried changing the animations in the r15 animator script.
Sorry im kinda new to roblox studio