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: How do you CFrame the Camera

Previous Thread :: Next Thread 
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
27 Jul 2013 12:44 PM
Wiki doesn't help.
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
27 Jul 2013 12:44 PM
Sorry, cframe.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
27 Jul 2013 12:46 PM
CurrentCamera.CoordinateFrame = CFrame(x,y,z)

I disabled my siggy.
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
27 Jul 2013 12:47 PM
Could you please tell us what you are trying to do? CFraming is very broad.
Report Abuse
Orinus is not online. Orinus
Joined: 19 Jul 2013
Total Posts: 39
27 Jul 2013 12:48 PM
Im trying to rotate the camera so it's like runescape or dungeon delver

(Like looking down on you from the southeast but it follows the player)
Report Abuse
Orinus is not online. Orinus
Joined: 19 Jul 2013
Total Posts: 39
27 Jul 2013 12:52 PM
But, I dont know if thats his problem
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
27 Jul 2013 12:52 PM
Funny thing, it is
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
27 Jul 2013 12:56 PM
Ah, in that case, I'll write something neat for you.
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
27 Jul 2013 01:06 PM
It's dangerous to go alone. Take this:

local TAU = 2 * math.pi -- equivalent of 360 degrees; a full turn
local RunService = Game:GetService("RunService")

-- The following three values are variables. You can change them while the script is running.
local pitch = 0.25 * TAU
local yaw = 0.25 * TAU
local distance = 20 -- might not work correctly with the "Custom" CameraType.

RunService.Stepped:connect(function()
    local camera = Workspace.CurrentCamera
    local focus = camera.Focus.p
    local origin = CFrame.new(focus) * CFrame.Angles(0, yaw, 0) * CFrame.Angles(pitch, 0, 0) * Vector3.new(0, 0, -distance)
    camera.CoordinateFrame = CFrame.new(origin, focus)
end)
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
27 Jul 2013 01:20 PM
Hey, Noli

I have a better one than Dungeon Delvers c:
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
27 Jul 2013 01:21 PM
I'm not sure what you mean by Dungeon Delvers. Is it a rogue-like game?
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
27 Jul 2013 01:23 PM
just play my game

that's better than the Dungeon Delvers camera.

c:
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
27 Jul 2013 01:31 PM
I can't play ROBLOX at the moment. That's why I'm here, so that I can at least script stuff.
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