Hello.
I am trying to make a game like the games where you are a marble. I have gotten the controls to work but when I pan my camera up so I see the marble from on top, I go slower left and right. I think this has to do with the camera's lookVector if I'm not wrong.
game:GetService("RunService").RenderStepped:Connect(function()
if canMove.Value == true then
bodyVelocity.AngularVelocity = Vector3.new() --// The bodyVelocity is a BodyAngularVelocity
local direction = controlModule:GetMoveVector()
if direction.X > 0 then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + direction.X * speed * camera.CFrame.LookVector
end
if direction.X < 0 then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + direction.X * speed * camera.CFrame.LookVector
end
if direction.Z > 0 then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + direction.Z * speed * camera.CFrame.RightVector
end
if direction.Z < 0 then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + direction.Z * speed * camera.CFrame.RightVector
end
else
bodyVelocity.AngularVelocity = Vector3.new()
end
end)
Any helps appreciated and try not to rewrite the whole code. If you know a solution just say what I have done wrong/have to do.
Thanks.
EDIT: If you want to see the problem for yourself (Here)
