This kinda what I am aiming for, however at the end you can see, I can just use the mouse to rotate camera view, etc. I want it locked looking at the player and following the player as it moves left right, up down, but it should never rotate
What I tried is to set it to the players character, but that didn’t really work
-- Setting the camera while the transition UI is blocking players view
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Character.PrimaryPart.CFrame
You have to update the camera’s cframe, preferably using runservice.
Based on your needs all you really need to do is to offset the camera from the character’s position and make sure it is rotated the right way.That should look something like this:
local RS = game:GetService("RunService")
function EnterRoomCamera()
Camera.CameraType = Enum.CameraType.Scriptable
RS:BindToRenderStepped("RoomCameraUpdate",Enum.RenderPriority.Camera.Value + 1,function()
Camera.CFrame = CFrame.Angles(0,someAngle,0) + Character.HumanoidRootPart.CFrame.Position + AnOffset
end)
end
You would need to set the rotation so that it is facing the room. If you want it so that the camera goes back to normal when they leave the room, just unbind the function using the :UnbindMethod and the id. The offset is a vector3 which would position the camera off of the humanoid root part. You would need to adjust that so the camera is positioned correctly relative to the humanoid root part.
If that’s easiest yes. Although there are other options such as specifying the direction and offset for each room and then having the function use those. Depends on how players go to the rooms and where they are placed.
You’re adding a number (15) to a Vector3 (Character.HumanoidRootPart.CFrame.Position) which won’t work. Like how Waffle had it above you can define a Vector3 offset and add that instead:
local AnOffset = Vector3.new(0, 15, 0) -- Whatever offset you're looking for
Camera.CFrame = CFrame.Angles(0,someAngle,0) + Character.HumanoidRootPart.CFrame.Position + AnOffset