yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 27 Sep 2015 09:55 PM |
It works perfectly in Studio, but not in an actual server. It ends up in a weird direction.
I tried putting it in a LocalScript, I tried using WaitForChild, everything I could think of, and it still wouldn't work.
Here's the script:
wait(.1)
local cam = workspace.CurrentCamera
local setPosition = workspace.Part.Position --or do Vector3.new() local lookPosition = workspace.Part2.Position --or do Vector3.new()
cam.CameraType = "Scriptable" cam.CoordinateFrame = CFrame.new(lookPosition,setPosition)
did i win |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 27 Sep 2015 10:06 PM |
Can someone help?
did i win |
|
|
| Report Abuse |
|
|
sporkyz
|
  |
| Joined: 04 Apr 2010 |
| Total Posts: 68 |
|
|
| 27 Sep 2015 10:09 PM |
| The reason why it isn't working in the server is because you are not getting the player's camera but the global camera which screws everything up. Well that is what I think is wrong anyways. |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 27 Sep 2015 10:24 PM |
How do I fix it?
I'm not that experienced at scripting tbh.
did i win |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 27 Sep 2015 11:12 PM |
| You need a LocalScript for this and parented within the player, and you don't need a wait unless you're waiting for something to load. |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 28 Sep 2015 05:09 PM |
@Raph
It's already in a LocalScript, and it still doesn't work.
did i win |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
| |
|
Zakusa
|
  |
| Joined: 16 Feb 2013 |
| Total Posts: 359 |
|
|
| 28 Sep 2015 06:32 PM |
| you dont need a local script you need a script because i dont see the word localplayer anywhere in that |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2015 06:33 PM |
^above learn to script before you answer questions.
I'm assuming you're just trying to prematurely access the camera. Try:
repeat wait() until game.Players.LocalPlayer.Character ~= nil
Netflix and chill? I prefer Blockbuster and relax. |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 28 Sep 2015 06:34 PM |
@Zak
I tried putting it in a regular script, and now it just doesn't work at all.
No errors or anything.
did i win |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
|
| 28 Sep 2015 06:40 PM |
@Ill
I tried that. It gives off an error. It won't let me post it here, so here you go:
http://pastebin.com/MtuF5BMK
did i win |
|
|
| Report Abuse |
|
|
Eston
|
  |
| Joined: 13 May 2008 |
| Total Posts: 21591 |
|
|
| 28 Sep 2015 06:41 PM |
No, no, no. I had the same question at one point, and these guys don't understand. If you want to have your script work as soon as a player enters, put your LocalScript into ReplicatedFirst. Also, use these cam.CameraType = 0 -- fixed camera cam.CoordinateFrame=CFrame.new(x, y, z) -- position of camera in 3d space cam.FieldOfView=70 cam.Focus=CFrame.new(x, y, z) -- where camera focuses |
|
|
| Report Abuse |
|
|
yeox769
|
  |
| Joined: 21 Jun 2010 |
| Total Posts: 8907 |
|
| |
|
Eston
|
  |
| Joined: 13 May 2008 |
| Total Posts: 21591 |
|
| |
|