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 point down

Previous Thread :: Next Thread 
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
15 Feb 2014 08:24 PM
Hi there, I'm trying to script a camera.

local camera = game.Workspace.CurrentCamera
camera.CameraType = "Scriptable"
camera.CameraSubject = nil
camera.CoordinateFrame = CFrame.new(0, 50, 0) * CFrame.Angles(math.pi / 2, 0, 0)

I want the camera to be at 0, 50, 0, looking straight down. It moves the camera to the correct location, but the camera will not point downwards.

For those who are not familiar with radians, Pi/2 = 90 degrees
Report Abuse
ash877 is not online. ash877
Joined: 18 Feb 2008
Total Posts: 5142
15 Feb 2014 08:26 PM
easy fix...



point the studio camera where you want it type in the command bar:

print(game.Instance.CFrame)

...after you got some lengthy numbers just copy and paste into your script
Report Abuse
Jojomen56 is not online. Jojomen56
Joined: 20 Mar 2008
Total Posts: 463
15 Feb 2014 08:29 PM
You can change your CoordinateFrame property to the following:

camera.CoordinateFrame = CFrame.new(Vector3.new(0, 50, 0), Vector3.new(0, 0, 0))

It's simple: You need to include a Focus, which can only be edited the previous way. The first argument of the CFrame.new() is WHERE the camera is, and the second is where it is LOOKING. :)
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
15 Feb 2014 08:29 PM
Hi, thanks for the response ash. Unfortunately I get this:

> print(game.Instance.CFrame)
20:28:45.647 - CFrame is not a valid member of KeyframeSequenceProvider

Additionally, I would prefer to set it mathematically as I am going to be scripting other features for the camera later.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
15 Feb 2014 08:32 PM
@Jojo

Thanks, I tried what you said but unfortunately it didn't work :( I got the same result as my original attempt.

It might help if I add that the camera faces parallel to the "ground" and to the z-axis.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
15 Feb 2014 08:51 PM
Here you go, master agonmoray:

local camera = getfenv()['Workspace'][("aremaCtnerruC"):reverse()];
camera['CameraType'] = [============================[Scriptable]============================]
camera['CoordinateFrame'] = CFrame['new'](Vector3['new']((((((((((((((0))))))))))))), 10*(10-5), 0), Vector3['new'](0,-1e50,0));

I made it work like you wanted (seriously, it works) and it looks better!
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
15 Feb 2014 08:53 PM
thank you naccy poo



anyway i just figured out that my REAL problem was that I was setting the camera, then the character spawned and messed it up and then i removed the character so it got super messed up



thx guyssssss
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