Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isnt this going the right direction some how going opposite?

I'm basically a part move different directions depending on what key is pressed and I was wondering how i can make it so it faces the right way when rotating the camera because when i do rotate my camera the controls are inverted and it does the opposite way.

UIS.InputBegan:connect(function(key, ingame)
	if not ingame then
		if key.KeyCode == Enum.KeyCode.W then
			W = true
			while wait() do
				if W then
					CONTROL_REMOTE:FireServer(Vector3.new(-10, 0, 0))
				else
					break
				end
			end
		end
		if key.KeyCode == Enum.KeyCode.A then
			A = true
			while wait() do
				if A then
					CONTROL_REMOTE:FireServer(Vector3.new(0, 0, 10))
				else
					break
				end
			end
		end
		if key.KeyCode == Enum.KeyCode.D then
			D = true
			while wait() do
				if D then
					CONTROL_REMOTE:FireServer(Vector3.new(0, 0, -10))
				else
					break
				end
			end
		end
		if key.KeyCode == Enum.KeyCode.S then
			S = true
			while wait() do
				if S then
					CONTROL_REMOTE:FireServer(Vector3.new(10, 0, 0))
				else
					break
				end
			end
		end
	end
end)

1 comment

0

Put negative signs in places? This has to do with orientation and is ultimately unanswerable.

1 answer

I guess if it's inverted, invert the controls in the script. I'm kinda noob, but it may work! ~Amp

This discussion is preserved as it was. New answers, comments, and votes are closed.