I have been trying to make a reverse gravity script that flips the player upside down along with their gravity so they can walk/jump on the ceiling but I don’t know where to start!
If anyone has experience with this issue I would love it if you helped out!
Place everything where it needs to go (Instructions in model)
Paste this into the “Main” script:
local PLAYERS = game:GetService("Players")
local GravityController = require(game:GetService("ReplicatedStorage"):WaitForChild("GravityController"))
local Controller = GravityController.new(PLAYERS.LocalPlayer)
-- Reverse Gravity Up Function
function GetReversedGravityUp(self, oldGravityUp)
-- Always return the reversed "up" direction
return Vector3.new(0, -1, 0)
end
-- Assign the custom gravity function
Controller.GetGravityUp = GetReversedGravityUp
-- Optional: Prevent humanoid auto-alignment
local character = PLAYERS.LocalPlayer.Character or PLAYERS.LocalPlayer.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.AutoRotate = false
Bam! Gravity reversed!
Edit: If you want to change gravity from a separate script add an event for local script and a remote event for server scripts and this to the code:
script.Event.Event:Connect(function(gravityVector)
function GetReversedGravityUp(self, oldGravityUp)
return gravityVector
end
-- Assign the custom gravity function
Controller.GetGravityUp = GetReversedGravityUp
end)