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
Put negative signs in places? This has to do with orientation and is ultimately unanswerable.