generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Return camera to player

Previous Thread :: Next Thread 
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 07:08 PM
b
Report Abuse
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 07:26 PM
bb
Report Abuse
DispenseTheDispenser is not online. DispenseTheDispenser
Joined: 20 Jun 2013
Total Posts: 2268
22 Dec 2014 07:27 PM
The CameraSubject needs to be a part, lol
Report Abuse
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 07:30 PM
No it doesn't

http://wiki.roblox.com/index.php?title=Camera_manipulation
Report Abuse
Hibobb is not online. 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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 08:29 PM
bbbbb
Report Abuse
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 09:08 PM
bbbbbbbbbbbbbbbb
Report Abuse
dekkonot is not online. 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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
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 is not online. 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 is not online. 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 is not online. 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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
22 Dec 2014 10:51 PM
still no luck qq
Report Abuse
lolb3 is not online. 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 is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
22 Dec 2014 11:16 PM
Shhhhh. Everyone makes mistakes, Lolb3. :(
Report Abuse
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
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 is not online. 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 is not online. 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
BuriedBlock is not online. BuriedBlock
Joined: 14 Dec 2009
Total Posts: 3091
23 Dec 2014 12:17 AM
I fixed that and it still didn't work
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image