Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I am having trouble with Camera Manipulation. Please help?

Asked by 8 years ago

So basically what I am having trouble with is, when Title.Playbutton is clicked, everything works fine except the cam.CameraSubject. Everything from line 7 and up works, line 9 and down is where I am ahving issues. Thank you for taking your time to deal with my dumb issues., :)

01cam = game.Workspace.CurrentCamera
02local player = game.Players.LocalPlayer
03intro = player.PlayerGui:WaitForChild("Intro")
04 
05cam.CameraSubject = game.Workspace.IntroFocus
06cam.CameraType = "Attach"
07Instance.new("BlurEffect", cam).Size = 11
08 
09intro.Title.PlayButton.MouseButton1Click:connect(function()
10    cam.CameraSubject = player.Character.Humanoid
11    cam.CameraType = "Fixed"
12    print'camerafix'
13end)
0
What is the issue specifically? 1N0body 206 — 8y
0
On line 10, the camerasubject of cam doesnt go back to the LocalPlayer's Humanoid. ObscureIllusion 352 — 8y
0
Is this in a localscript? Does it give any errors? 1N0body 206 — 8y
0
It is indeed a local script, and no it does not give any errors. ObscureIllusion 352 — 8y

1 answer

Log in to vote
0
Answered by
1N0body 206 Moderation Voter
8 years ago
Edited 8 years ago

Ok, I've tried to recreate the problem and seems out it is way more complicated than I thought.

Here is the final script I put into which I believe is the solution:

01local cam = game.Workspace.CurrentCamera
02local player = game.Players.LocalPlayer
03local intro = player.PlayerGui:WaitForChild("Intro")
04 
05cam.CameraSubject = game.Workspace.IntroFocus
06cam.CameraType = "Scriptable"
07 
08cam.CoordinateFrame = CFrame.new(workspace.IntroFocus.Position)  --Position of target
09                           * CFrame.Angles(0, angle, 0) --Rotates in radians(math.rad)
10                           * CFrame.new(0, 0, 8)       --Move the camera backwards
11-- If you don't want this then just delete and put back the CameraType to 'Attach'; but I ran into
12-- issues using it.
13 
14Instance.new("BlurEffect", cam).Size = 11
15 
View all 22 lines...

Not sure if this will work out for you, but this the best I could do

EDIT: Code edited

0
Nope, sadly didnt work ): I mean, everything works but the camera subject still doesnt change to the player's humanoid. ObscureIllusion 352 — 8y
0
Oh.. Yeah, I know why. Need to add a wait() between line 18 and 19, wait till I edit the code with a proper wait method (script does things faster then the camera rendering, most likely) 1N0body 206 — 8y
0
Ok there you go 1N0body 206 — 8y
0
Okay so everything works, except that when you click the playbutton button, and it goes back to your humanoid, it just sticks to one place, like it doesnt move along with the humanoid, just stays there in the same place where the Humanoid was when you pressed the PlayButton. ObscureIllusion 352 — 8y
View all comments (2 more)
0
Remove line 19 and 20 1N0body 206 — 8y
0
Ah thank you! :) ObscureIllusion 352 — 8y
Ad

Answer this question