Hello. I’m working on a small camera rotation system and I’m wondering how to rotate my part relative to worldspace, keeping the same ‘downward’ angle. Here is a video as to what happens:
This script will rotate your camera around an object in world space.
-- Rotate camera around model
local Offset = CFrame.new(0, 10, 30)
local TargetOffset = Vector3.new(0, 0, 0)
local TargetPos = ROTATE_AROUND_PART.Position + TargetOffset
local A = 0
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, function(Tick)
A = A + Speed * Tick
Camera.CFrame = CFrame.new((CFrame.new(TargetPos)
* CFrame.Angles(0, math.rad(A), 0)
* Offset).Position, TargetPos)
end)
I don’t want it to be rotating around an object. I’d like for it to just TURN 90 degrees to the left/right, keeping the same downward angle. If you look down and you turn 90 degrees, you’ll still be looking down.