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