What I want to make
- I want to make my own gravity controller/wall walking script, and I’ve made some considerable progress. I’ve already made the player able to walk on walls by making my own player movement script and all I have to do is re-create the jump button, make the player rotate their character depending on where the camera is pointing at, and make the player tilt their character when walking on rotated surfaces in order to change their gravity.
THE ISSUES
-
When making the player rotate, it works completely fine until the player the falls off of the surface they’re walking on. Whenever the player falls off of the surface they’re walking on, the game seems to softlock (I can’t move my character at all).
-
A second issue I have is that the script I have can cling on to any walls that are touched instead of focusing on the walls/floors beneath the player
Video examples with “Streaming Integrity mode” both enabled and disabled
below are videos of the slope tilting script clinging on to vertical walls that the player shouldn’t cling on unless the player went on a slope that gradually changed from horizontal to vertical
(In these videos, I fall off of the wall, but the issue I stated before can happen anytime I fall off of a wall. I was just lucky in these videos)
I have not thought of any possible solutions as I don’t know why this would happen in the first place
I used a script that tilts the character based on the slope the character is standing on. I then edited it so it can work with my gravity controller script. Here is both the slope tilting script I’m using and I the post I originally got it from
local char = script.Parent
local rootPart = char.CustomMovementModel.MoverBlock
local xzGyro = char.CustomMovementModel.MoverBlock.AlignOrientation
local yGyro = char.CustomMovementModel.MoverBlock.AlignOrientation
while wait(.5) do
local params = RaycastParams.new()
params.FilterDescendantsInstances = {char}
params.FilterType = Enum.RaycastFilterType.Blacklist
local result = workspace:Raycast(rootPart.Position, Vector3.new(-10,-10,-10), params)
yGyro.CFrame = CFrame.new(rootPart.Position, rootPart.Position + char.Humanoid.MoveDirection*10)
if (result) then
--print(result.Normal)
local currentRightVector = rootPart.CFrame.RightVector
local upVector = result.Normal
local newFacialVector = currentRightVector:Cross(upVector)
xzGyro.CFrame = CFrame.fromMatrix(rootPart.Position, currentRightVector, upVector, newFacialVector)
end
end
Lastly, yes I know there is an open sourced gravity controller out there, but I want to make my own