CFrame acting weird

ALRIGHT, this is probably the weirdest thing i have encountered on roblox.
Ive tried 4 diffrent ways to move the player but they all did the same.
Ive recorded a video with an UI showing what keys i pressed.

Katrists script straight up doesnt move the character up or down, with no errors whatsoever.
And eqis’es script works same as mine…

It took a little to respond i know.

I have 0 clue why it’s doing that, although it’s probably something to do with the binding and unbinding of the render stepped. How about this different solution that simply changes the direction and doesn’t unbind?

local direction = 0

function OnRenderStep()
    player:PivotTo(player:GetPivot() * CFrame.new(0, direction, 0))
end

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Up then
            direction = -1
	elseif input.KeyCode == Enum.KeyCode.Down then
           direction = 1
	end
end)

UIS.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Up or input.KeyCode == Enum.KeyCode.Down then
		direction = 0
        end
end)

RS.RenderStepped:Connect(OnRenderStep)

It works!!!
the controls were reversed though, thanks for the help :D.

1 Like