Mounting system isnt working right

Hello I am currently working on a mounting system, what my script does is basically receive the input key the player is pressing and based on that, choose the direction the mount is supposed to go, then send it to the server using a remote event and the serverscript makes the mount’s humanoid MoveTo the position.

the problem is when I test it, it just started rotating randomly
here is my local script:


local movements = {
	forward = Enum.KeyCode.W,
	left  = Enum.KeyCode.A,
	right = Enum.KeyCode.S,
	back = Enum.KeyCode.D,
	up = Enum.KeyCode.Space--will be used for later 

}

local function getforwardpos(part)
	return part.CFrame + part.CFrame.LookVector * 100
end

local function getrightpos(part)
	return part.CFrame + part.CFrame.RightVector * 100 
end

local function getleftpos(part)
	return part.CFrame + -part.CFrame.RightVector * 100
end

UIS.InputBegan:Connect(function(input, gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard then--going to add mobile and xbox support after I get this figured out
	local keyPressed = input.KeyCode
		print(keyPressed)
		if keyPressed == movements.forward then
			game.ReplicatedStorage.MoveRide:FireServer(script.Parent.Parent.PlayerGui.Riding.Value, getforwardpos(script.Parent.Parent.PlayerGui.Riding.Value:FindFirstChild("HumanoidRootPart")))
		elseif keyPressed == movements.left then
			game.ReplicatedStorage.MoveRide:FireServer(script.Parent.Parent.PlayerGui.Riding.Value, getleftpos(script.Parent.Parent.PlayerGui.Riding.Value:FindFirstChild("HumanoidRootPart")))
		elseif keyPressed == movements.right then
			game.ReplicatedStorage.MoveRide:FireServer(script.Parent.Parent.PlayerGui.Riding.Value, getrightpos(script.Parent.Parent.PlayerGui.Riding.Value:FindFirstChild("HumanoidRootPart")))
		end
	end
end) 

should be atleast different keybinds than the normal WASD also when you move your character and the keybinds is still the same then that is the problem

So pretty much, the position is not only being changed by the current local script, which is causing the mount not to move to its position?

yes actually if it has still the same keybinds as the keybinds when you move

And this mean I need to temporarily disable character input like platformstand?

Turns out the problem was I was setting the moveTo() part in the humanoid already which was causing the movement to be changed, and at the same time yes, the keybinds were already set