|
| 02 Mar 2015 07:54 PM |
| I need the camera to stay in place when a player enters my game, no movement at all. |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 02 Mar 2015 07:59 PM |
It requires two scripts.
A regular script in Workspace, and a localscript inside of it. Should look like:
Script LocalScript
Script's code is game.Players.PlayerAdded:connect(function(player) script.LocalScript:clone().Parent=player.CharacterAdded:wait() end)
Localscript's code is local time = 0 -- put your time in local cam = workspace.CurrentCamera wait(1) cam.CameraType="Scriptable" cam.CFrame=CFrame.new(0,0,0) -- This is the position the camera is positioned at. cam.Focus=CFrame.new(0,0,0) --This is the position the camera looks at. wait(time) cam.CameraType="Follow" cam.CameraSubject=workspace[game.Players.LocalPlayer.Name].Humanoid
You are welcome. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 02 Mar 2015 08:07 PM |
not how you use the camera
-- local script, place it in StarterGui
local cam = game.Workspace.CurrentCamera
local CameraLocation = Vector3.new(0,100,0) -- position the camera sits at
local CameraDirection = Vector3.new(0,0,0) -- position the camera looks at
cam.CameraType = Enum.CameraType.Scriptable
game["Run Service"].RenderStepped:connect(function() cam.CoordinateFrame = CFrame.new(CameraLocation,CameraDirection) end)
-- |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 02 Mar 2015 08:13 PM |
@chimmi He said when a player enters his game. And no movement at all. I provided it for him. It works. |
|
|
| Report Abuse |
|
|
|
| 02 Mar 2015 08:37 PM |
@Blade,
You have obviously never scripted a camera before...
A camera script looks nothing like that gg |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
| |
|
|
| 03 Mar 2015 04:39 PM |
| Thank you both, even if one doesn't work, thanks for trying! I had no idea how to do that lol |
|
|
| Report Abuse |
|
|
BladeXE
|
  |
| Joined: 22 Dec 2012 |
| Total Posts: 3857 |
|
|
| 07 Mar 2015 09:14 AM |
fine but mine still works even if it doesn't look good. |
|
|
| Report Abuse |
|
|
|
| 02 Nov 2015 04:02 PM |
This isn't that old, but it's old enough to hijack.
After you do the fixed camera position, how do you make the camera return to the player character on mouseclick? E.g., if you wanted to have a title screen with a fixed camera, but wanted the camera to be normal when they press play?
My current script looks like:
function onClicked() title:Destroy() cam.CameraType = Enum.CameraType.Fixed
With the function being called at: button.MouseButton1Down:connect(onClicked).
What am I doing wrong here? Thanks in advance. |
|
|
| Report Abuse |
|
|