Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 30 Dec 2016 10:59 PM |
| How do I make the camera focus on player once clicking a textbutton? |
|
|
| Report Abuse |
|
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
| |
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
| |
|
| |
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 30 Dec 2016 11:20 PM |
| so i have the camera rotating around a part i want it to when i click a textbutton the camera is on player normally. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 11:22 PM |
inside of a local script that's parent is the textbutton
local camera = workspace.CurrentCamera
local cameraSubject = camera.currentSubject
local button = script.Parent
button.MouseButton1Click:connect(function() local players = game.Players:GetPlayers() for i = 1,#players do if string.lower(button.Text) == string.lower(players[i].Name) then cameraSubject = players[i].Character.Head end end end)
|
|
|
| Report Abuse |
|
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
|
| 30 Dec 2016 11:29 PM |
| currentSubject is not a valid memeber of player |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 11:30 PM |
Oops, I made that mistake with the variable as I was typing it and didn't realize I made it when I defined it too. Changed currentsubject to CameraSubject
|
|
|
| Report Abuse |
|
|
Bylocks
|
  |
| Joined: 27 Mar 2012 |
| Total Posts: 773 |
|
| |
|
|
| 30 Dec 2016 11:38 PM |
Errors? Wrote it off of the top of my head, so who knows what might've gone wrong lol.
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 11:48 PM |
Oh uh this also assumes that the textbuttons text is the players name
|
|
|
| Report Abuse |
|
|