Hello.
I’m trying to make a game where your character is a ball and you use bodyVelocity to move.
(https://www.roblox.com/games/4914061613/)
I have got the controls to work with a keyboard from just doing this.
game:GetService("RunService").RenderStepped:Connect(function()
bodyVelocity.AngularVelocity = Vector3.new()
if userInputService:IsKeyDown(Enum.KeyCode.W) then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + camera.CFrame.RightVector*-speed
end
if userInputService:IsKeyDown(Enum.KeyCode.S) then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + camera.CFrame.RightVector*speed
end
if userInputService:IsKeyDown(Enum.KeyCode.A) then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + camera.CFrame.LookVector*-speed
end
if userInputService:IsKeyDown(Enum.KeyCode.D) then
bodyVelocity.AngularVelocity = bodyVelocity.AngularVelocity + camera.CFrame.LookVector*speed
end
end)
Now I am trying to make it work for controller and mobile. I have found out that you can use controlModule:GetMoveVector to get the MoveVector from all devices. How would I apply the camera’s lookVector and rightVector to this? I can’t multiply the moveVector with the lookVector and rightVector at the same time.
Any help appreciated.