Guess by what you have written if someone is just clicking the text box and not typing any certain string
then you should replace that with a Text Button. When scripting a Camera for the local player you have to have a Local Script inside of a Normal Script. Then to get that local script in side the players model you would use this.
1 | game.Players.PlayerAdded:connect( function (player) |
2 | player.CharacterAdded:connect( function (character) |
3 | script.LocalScript:clone().Parent = character |
Inside the local script you would put what you wanted the camera to do for example: If you want the camera to attach to some type of part you would put this cam.CameraSubject=workspace.Part
Camera Type Would look like this
cam.CameraType = "Attach"
Coordinate Frame Would look like this
cam.CoordinateFrame=CFrame.new(10,10,10)
If you want it to circle a part you would do this
01 | local target = workspace.Part |
02 | local camera = workspace.CurrentCamera |
03 | camera.CameraSubject = target |
07 | camera.CoordinateFrame = CFrame.new(target.Position) |
08 | * CFrame.Angles( 0 , angle, 0 ) |
09 | * CFrame.new( 0 , 0 , - 5 ) |
10 | angle = angle + math.rad( 1 ) |
Fixing the Camera once your done when text box is clicked / button Assuming you already got the function onClick()
.
All of the scripts above that says local
in it goes inside the local script.
1 | game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid |
2 | game.Workspace.CurrentCamera.CameraType = "Custom" |
Some of the information above was taken from the website Roblox Wiki Camera manipulation
Locked by JesseSong
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?