I am trying to make a script that makes your character face forwards when right click is down, also when u turn, your character turns too.
Here is a visual of what I am trying to make
As you can see someone has made this before by someone so I am trying to make it for myself. If you guys can make it for me that'd be AWESOME, also leading me in the right direction on how to make this would be greatly appreciated aswell.
Trick here is the CameraType = Enum.CameraType.Attach, you connect it to an InputBegan function, and switch it back to Enum.CameraType.Custom, on InputEnded.
In a localscript
local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera local inputService = game:GetService('UserInputService') inputService.InputBegan:connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton2 then camera.CameraType = Enum.CameraType.Attach end end) inputService.InputEnded:connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton2 then camera.CameraType = Enum.CameraType.Custom end end)