Hi folks! I was recently promoted to member so this is my first post (disclaimer this may not be a great post).
Right now I am trying to create a spaceship game where you can be in space and go in and out of your spaceship. When you are in your space ship I want to create artificial gravity that allows the player to stick to the ships floor no matter what maneuvers are done (Ex. when the ship goes upside down instead of the players falling onto the ceiling they stay on the floor and are able to walk around and jump still). Is this even possible? If so how might I go about doing it? I have searched the dev hub for a while and couldn’t find anything helpful. Thanks in advance! - Qbizh
The code you need to modify is the GetGravityUp function (in the example, it’s being set in the LocalScript in StarterCharacterScripts. In your case, you should set it so that the current “floor” determines the gravity vector, which might look something like this:
function GetGravityUp(self, oldGravityUp)
return FLOORPART.CFrame.UpVector
end