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!
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.
- 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.