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 » Scripting Helpers
Home Search
 

Re: camera problem

Previous Thread :: Next Thread 
TheDominantLord is not online. TheDominantLord
Joined: 23 Aug 2011
Total Posts: 7866
17 May 2014 01:11 AM
im trying to make it so your camera is rotating around a part while your character is removed as soon as you join the game

here's what i have

--Main Script

game.Players.PlayerAdded:connect(function(p)
c = script.LocalScript:clone()
c.Disabled = false
c.Parent = p.PlayerGui
wait()
p.Character()
end)

--Local Script

local target = workspace.camSubject
local camera = workspace.CurrentCamera
camera.CameraSubject = target
local angle = 0

while wait() do
camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0,angle,0) * CFrame.new(0,-5,0)
angle = angle + math.rad(1)
end
Report Abuse
robertjh12 is not online. robertjh12
Joined: 24 Feb 2008
Total Posts: 601
17 May 2014 01:27 AM
Change cameratype to scriptable for during rotation.
Report Abuse
TheDominantLord is not online. TheDominantLord
Joined: 23 Aug 2011
Total Posts: 7866
17 May 2014 01:58 AM
still doesnt work
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
17 May 2014 03:06 AM
You never stated the problem
Report Abuse
TheDominantLord is not online. TheDominantLord
Joined: 23 Aug 2011
Total Posts: 7866
17 May 2014 11:37 AM
nothing happens
thats my problem
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
17 May 2014 12:46 PM
I tested your camera script, and it doesn't rotate. It just stays on the brick, not roating, and not moving. Try viewing the player's head as a target. I fixed your not working problem, but when the character's removed, the camera gets stuck in one spot, and the camera script stays on the brick, and doesn't move, and can't be moved. But, you can easily solve this by just making the player invisible.

Use for the main script. Put the localscript inside the main script:


Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
script.LocalScript:Clone().Parent = character
player.Character.Torso.Transparency = 1
player.Character.Head.TramsParency = 1
player.Character.RightArm.Transparency = 1
player.Character.LeftArm.Transparency = 1
player.Character.LeftLeg.Tramsparency = 1
player.Character.RightLeg.Transparency = 1
player.Character.Humanoid.WalkSpeed = 0
end)
end)

For the local script:

local Targ = Game.Players.LocalPlayer.Character.Head
local Cam = Game.Workspace.CurrentCamera
Cam.CameraSubject = Targ
Spin = 3
while wait() do
Cam.CoordinateFrame = CFrame.new(Targ.Position) * CFrame.Angles(2,Spin,4) * CFrame.new(0,-5,0)
Spin = Spin + math.rad(1)
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
17 May 2014 12:47 PM
Oops. Be sure toadd an end after the cam script. I forgot to put an end for the while wait() do.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
17 May 2014 12:48 PM
DON'T USE THE SCRIPTS ABOVE. USE THESE ONES.

Use for the main script. Put the localscript inside the main script:


Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
script.LocalScript:Clone().Parent = player.PlayerGui
player.Character.Torso.Transparency = 1
player.Character.Head.Transparency = 1
player.Character:FindFirstChild("Right Arm").Transparency = 1
player.Character:FindFirstChild("Left Arm").Transparency = 1
player.Character:FindFirstChild("Left Leg").Transparency = 1
player.Character:FindFirstChild("Right Leg").Transparency = 1
player.Character.Humanoid.WalkSpeed = 0
end)
end)

For the local script:

local Targ = Game.Players.LocalPlayer.Character.Head
local Cam = Game.Workspace.CurrentCamera
Cam.CameraSubject = Targ
Spin = 3
while wait() do
Cam.CoordinateFrame = CFrame.new(Targ.Position) * CFrame.Angles(2,Spin,4) * CFrame.new(0,-5,0)
Spin = Spin + math.rad(1)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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