|
| 22 Dec 2014 06:51 PM |
I have a script in ReplicatedFirst that replaces the loading screen with a camera position. Everything is working but the camera isn't returning to the player. I'm not getting any errors in local console when I test via server. I think it might be I have to use a waitforchild on Character and then on Humanoid, but I'm not sure how
while game.ContentProvider.RequestQueueSize > 0 do screen:Remove() cam.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid") cam.CurrentCamera.CameraType = Enum.CameraType.Custom
wait(.3) end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Dec 2014 07:27 PM |
| The CameraSubject needs to be a part, lol |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2014 07:30 PM |
No it doesn't
http://wiki.roblox.com/index.php?title=Camera_manipulation |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 22 Dec 2014 07:30 PM |
| Not when returning it to the character. Most likely you are continually trying to destroy "screen". Once it is destroyed, the script breaks trying to destroy something that doesnt exist |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2014 07:32 PM |
| I moved it out of that and put it before it, still everything works but camera doesn't return to the player |
|
|
| Report Abuse |
|
|
| |
|
| |
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 22 Dec 2014 09:18 PM |
| A player's character is not loaded before scripts run, so try waiting until the character exists. |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2014 10:35 PM |
@dekk That's what I was thinking, but how do it? Would it be game.Players.LocalPlayer:WaitForChild("Character").Humanoid? Because wouldn't I have to wait for the humanoid also? |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 22 Dec 2014 10:36 PM |
You could do
game:GetService("Players").LocalPlayer:WaitForChild("Character"):WaitForChild("Humanoid")
if you're worried. |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 22 Dec 2014 10:42 PM |
why wait for humanoid? btw im pretty sure character isn't a child of player. try
player = game:getService("Players").LocalPlayer player.CharacterAdded:wait() player.Character:WaitForChild("Humanoid") |
|
|
| Report Abuse |
|
|
jbjgang2
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 8948 |
|
|
| 22 Dec 2014 10:43 PM |
try this:
while game.ContentProvider.RequestQueueSize > 0 do screen:Remove() game.Players.LocalPlayer.Character:WaitForChild("Humanoid") cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid cam.CurrentCamera.CameraType = Enum.CameraType.Custom
wait(.3) end
Swaggin' Since Twenty Ten |
|
|
| Report Abuse |
|
|
| |
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 22 Dec 2014 10:53 PM |
oh
cam.CurrentCamera.CameraType = Enum.CameraType.Custom
cam.CameraType = Enum.CameraType.Custom |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 22 Dec 2014 11:16 PM |
| Shhhhh. Everyone makes mistakes, Lolb3. :( |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2014 11:44 PM |
| I'm going to make a new thread but with the whole script. Maybe that will help |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 22 Dec 2014 11:46 PM |
while wait(.3) do screen:Remove() game.Players.LocalPlayer.Character:WaitForChild("Humanoid") cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid cam.CameraType = Enum.CameraType.Custom end
Try that. :p |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 23 Dec 2014 12:08 AM |
| buried the problem is that you tried to get CurrentCamera of CurrentCamera |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 12:17 AM |
| I fixed that and it still didn't work |
|
|
| Report Abuse |
|
|