Is there a way to change the position and angle of the camera when you first spawn into a game, instead of the camera just facing the back of the character? When this is changed, is there also a way to make is so that it isn’t permanent, only in the certain angle until the camera is moved by the player?
Wrong category, but anyways you’ll want to learn about the properties of a camera and then modify them via localScript to achieve your effect.
Yea it’s pretty easy
Add a LocalScript to StarterCharacterScripts, and put that code inside it.
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.Position = Vector3.new(--Put the new position of the camera here--)
camera.Orientation = Vector3.new(--Put the new orientation of the camera here--)
And don’t worry … The LocalScript will fire once a player joins the game.
Hope it helps!
Thank you for the help, I have tinkered a bit but keep getting the error, “Position is not a valid member of Camera” although it is, do you have any tips to fix this?
Weird.
Well try this
Delete the camera.Position and camera.Orientation lines.
And put this code instead
camera.CFrame = CFrame.Angles(0, math.rad(-180), math.rad(-180)) -- That's the orientation .. You must put 'math.rad' in every axis and then put the number inside it to get the orientation process working.
This line only changes the orientation to make the camera upside down.
I tried it and it worked, but it may not work for you as intended.
You also can change the position, but if you did, it won’t make the camera upside down.
And if you want to get the camera to its default properties, type that code
camera.CameraType = Enum.CameraType.Follow
Try this out and tell me if it works well for you.
ya, the orientation works fine, Thank you! I have been trying to do the position but keep getting the same error, is there another way I could do this possibly then?
There is another way, but if you change the position of the camera, the camera won’t be upside down. But it might work for you.
Anyway, change it by writing this.
camera.CFrame = CFrame.new(--Put the position here)
Oh I see the error, You can’t assign position to the camera. You can only assign cframes. So do something like this:
Camera.CFrame = CFrame.new(x,y,z) -- Insert your x,y,z coordinates
And for all the nerds out there ready to call me out, yes I know that CFrames hold both position and orientations, no need to tell me.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.