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: Camera Manipulation, weird question?

Previous Thread :: Next Thread 
Lem0nzz2 is not online. 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 is not online. 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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
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