|
| 09 Mar 2015 02:32 PM |
Lately I've been experimenting some camera manipulation but sadly it only works in Solo mode. What it does is to check the name of a button and after that it searches in an folder a camera with the same name, then, after that, it changes the property of the CurrentCamera to the camera choosen. The properties changed are CoordinateFrame, Focus and FieldOfView.
Now, when I test it in Solo mode it works, but when I go to my ALT's place to test it, it doesn't works. Is this a roblox update? |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Mar 2015 02:47 PM |
| lol yeah make it a local script bruh |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 07:45 AM |
| Lol yeah it's obv a localscript. I am not like some that thinks that CurrentCamera exists for the whole server. I need the client's scope bruh |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Mar 2015 11:27 AM |
Top of the LocalScript: repeat wait() until game.Players.LocalPlayer.Character |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:06 PM |
@epicbreaker
Still doesn't works, already tried:
-repeat wait() until game.Players.LocalPlayer.Character
-while not game.Players.LocalPlayer.Character do wait() end
-game.Players:WaitForChild("Character") -- yup this one didn't even work |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:22 PM |
Character is a property, not a child..
Also, post your script. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:45 PM |
It is a bit too long, but if you want so...
repeat wait() until game.Players.LocalPlayer.Character wait(1)
local plr = game.Players.LocalPlayer local curcam = game.Workspace.CurrentCamera local monitor = false local button = script.Parent:FindFirstChild("Toggle") local cameras = game.ReplicatedStorage:FindFirstChild("Cameras") local gui = script.Parent:FindFirstChild("MonitorScheme") local choices = gui:FindFirstChild("Choices")
local currentCamera = nil local lastCamera = choices.MainCorridor
function changeCamera(node) if lastCamera == node then return end if node and cameras:FindFirstChild(node.Name) then lastCamera = node currentCamera = node ccam = cameras:FindFirstChild(node.Name) curcam.CameraType = "Scriptable" curcam.CoordinateFrame = ccam.CoordinateFrame curcam.Focus = ccam.Focus end end
function onToggled() if not monitor then monitor = true gui.Visible = true changeCamera(lastCamera) else monitor = false gui.Visible = false currentCamera = nil
curcam.CameraType = "Custom" curcam.CameraSubject = plr.Character:FindFirstChild("Humanoid") curcam.FieldOfView = 70 end end
function init() for _, c in pairs(choices:GetChildren()) do if c:IsA("TextButton") then c.MouseButton1Down:connect(c) end end end
init()
|
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:53 PM |
| Press F9 in-game, what's the error? |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:54 PM |
| Funny thing is, no errors. Not in Client-Side, nor in Server-Side. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 12:56 PM |
There should be.
Your variables are using :FindFirstChild(), instead of :WaitForChild() |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 01:00 PM |
| Well, I've already confronted problems with my scripts not finding it's contents inside the GUI. But anyways, I'll try and see if it works. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2015 01:34 PM |
| Try printing when you click the button. (In online) |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 01:36 PM |
| Click Detection works, but cameras still don't change. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2015 01:37 PM |
| *With both MouseButton1Down and MouseButton1Click |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 01:55 PM |
| I mean, with the two Events tested. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Mar 2015 02:56 PM |
if lastCamera == node then return end
You are literally passing lastCamera into node, so lastCamera will always equal node. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 10 Mar 2015 03:04 PM |
Also change
curcam.CoordinateFrame = ccam.CoordinateFrame curcam.Focus = ccam.Focus
to
curcam.CoordinateFrame = CFrame.new(ccam.CoordinateFrame.p, ccam.Focus.p)
There is a bug with the Scriptable CameraType where Focus does not behave properly. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 06:20 PM |
@epic
I removed that. Thanks for the tip.
@lucas
Nope, that didn't worked on online but on solo did (as always) |
|
|
| Report Abuse |
|
|