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

Locking a Camera on a character in thirdperson?

Asked by 10 years ago

I want to make a MOBA-type game, like LoL, so I tried to script myself a thirdperson camera that follows you around from a set distance. So I checked the ROBLOX wiki and found some help. I found that you have to use a LocalScript and put it in the character when they spawn. So I used the script provided:

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) script.LocalScript:clone().Parent = character end) end)

and found that it didn't actually add it in when I played on solo.

Furthermore, I don't think my actual camera setting script would work, because I just don't know what I'm doing. This is my LocalScript that I want to put into the character to change how they see things:

local cam = workspace.CurrentCamera

cam.CameraSubject = LocalScript.Parent.Head

cam.CameraType = "Track"

cam.Focus=CFrame.new(

The bottom one I was trying to make the tracking focus from a specific angle, but couldn't figure out how to do it. -_-

Please help. I'm imcompetent.

1 answer

Log in to vote
1
Answered by 10 years ago

Try this, it should work.

local player = game.Players.LocalPlayer

player.CameraMode = Enum.CameraMode.Classic
wait() 
player.CameraMode = Enum.CameraMode.LockDefault

If I helped, please leave a upvote. I am in the negative and I need to get back up. Thanks <3

0
Does it allow people to turn their cameras? Because I don't want people to be able to do that. Also, which script do I put it in? DiscoStriker 20 — 10y
0
If you want to force first person upon entering and resetting, put the following code in a LocalScript and insert the LocalScript into game.StarterPack or game.StarterGui. JustGimmeDaBux 18 — 10y
0
Sorry, I meant third person. I am making a game with First Person and I keep forgetting you need third. It should still work anyhow. JustGimmeDaBux 18 — 10y
0
Hm. It didn't work. I put the script you gave me in the starterpack as a local script, and nothing happened. DiscoStriker 20 — 10y
View all comments (7 more)
0
That's odd, because it worked just fine for me. JustGimmeDaBux 18 — 10y
0
Even when I used 3rdPerson mode it worked... try to put it in starterGui. JustGimmeDaBux 18 — 10y
0
I put it in the StarterGui and it's not doing it... I made a script testing place, and it's on my account if you want to check it out... DiscoStriker 20 — 10y
0
Awful odd... Sorry. Try one last thing please. Try editing line5 to player.CameraMode = Enum.CameraMode.LockDefault JustGimmeDaBux 18 — 10y
0
Okay, you got the distance locked. How do I get the camera to be fixed at a certain angle? DiscoStriker 20 — 10y
0
Do you mean, like, change the pointed angle of the camera? JustGimmeDaBux 18 — 10y
0
Keeping it in thirdPerson tho. JustGimmeDaBux 18 — 10y
Ad

Answer this question