Lem0nzz2
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 211 |
|
|
| 25 Jan 2015 07:09 PM |
| Alright so what I'm wanting to do is have a Camera Manipulate around a brick. I went to the wiki, and tried out the script and kept getting this error saying that target is a nil value. I believe the issue is that it's in starterGUI but im also wanting the Camera Manipulator to stop once you click on a button. So this is a issue because it needs to be inside of the GUI. |
|
|
| Report Abuse |
|
|
Lem0nzz2
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 211 |
|
|
| 25 Jan 2015 07:17 PM |
The question is where do I put the script, and why isn't it working? Here's the script:
--[[ Yes I copied from the roblox wiki the camera manipulation part, I don't understand it still, it's really bugging me. I'll try to learn some more about it later. ]]--
local Player = game.Players.LocalPlayer local mouse = Player:GetMouse() ClickedButton = false
function Clicked() ClickedButton = true end game.Players.PlayerAdded:connect(function(player) repeat wait() script.LocalScript:clone().Parent = player.CharacterAdded:wait() local target = workspace.Circle local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 0 while wait() do camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 0, 5) --Move the camera backwards 5 units angle = angle + math.rad(1) end until ClickedButton == true if ClickedButton == true then game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Custom" end end)
script.Parent.MouseButton1Down:Clicked() |
|
|
| Report Abuse |
|
|
Lem0nzz2
|
  |
| Joined: 03 Jul 2014 |
| Total Posts: 211 |
|
|
| 25 Jan 2015 07:20 PM |
| 17:19:50.273 - Players.Player.PlayerGui.LocalScript:11: attempt to index local 'target' (a nil value) |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 07:28 PM |
Hi Lem0nzz2,
You're script is trying to tell you there is no Circle inside of workspace, are you positive you got capitals right/no typos? |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 25 Jan 2015 07:30 PM |
Use this/scrap whatever you want out of it http://www.roblox.com/Camera-Rotation-item?id=124059808
I made it around two years ago, and I can't guarantee how efficient or how clean it is, but I do know that it is customizable. If I remember correctly I was using single letter variables at the time. Anyway, it does include a button to stop the rotation. |
|
|
| Report Abuse |
|
|