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: Free Camera

Previous Thread :: Next Thread 
ausmel105 is not online. ausmel105
Joined: 05 Oct 2010
Total Posts: 251
16 Apr 2016 10:23 AM
Hi all,

I'm trying to make a free cam which can be toggled on or off, rather simple you'd think.. but no :L I'm having issues finding a way in which to recover the character once it's been set to nil. I've tried numerous methods, but setting the character to equal nil and setting the camera type fixed appears to be the only way to achieve a free cam.

For whatever reason I'm unable to clone the existing character for later use, as setting the character instance to equal nil is an unrecoverable operation.

Anyway looking for some logic inspiration on how to do this,

this is my local script as it stands:

game.Players.LocalPlayer.CharacterAdded:wait()

local sp = script.Parent
local freecam = false
local char

sp.freecam.MouseButton1Click:connect(function()
if not freecam then
char = game.Players.LocalPlayer.Character:Clone()
char.Parent = game.Players.LocalPlayer
game.Players.LocalPlayer.Character=nil
workspace.CurrentCamera.CameraType = "Fixed"
else
workspace.CurrentCamera.CameraType = "Custom"
char.Parent = workspace
game.ReplicatedStorage.Respawn:FireServer(game.Players.LocalPlayer)
end
freecam = not freecam
end)
Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
16 Apr 2016 10:24 AM
http://wiki.roblox.com/index.php?title=Camera_manipulation#Fixing_the_camera_once_we.27re_done.
Report Abuse
malachi11 is not online. malachi11
Joined: 07 May 2008
Total Posts: 2420
16 Apr 2016 10:25 AM
I seem to remember from a long time ago that you used to need to change the archivable property of the character before cloning it... I don't remember what you needed to change it to, and I don't know if it is still like that, but you could try that.
Report Abuse
ausmel105 is not online. ausmel105
Joined: 05 Oct 2010
Total Posts: 251
16 Apr 2016 10:29 AM
@direMitten

Won't work as the character doesn't exist.
Report Abuse
ausmel105 is not online. ausmel105
Joined: 05 Oct 2010
Total Posts: 251
16 Apr 2016 10:29 AM
@malachi11

Yes! That worked, thank you.
Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
16 Apr 2016 10:32 AM
Can't you just set the player.Character to the character again?
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