Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 01:18 PM |
So Im trying to make it so that the camera rotates around a lower object and looks down upon it.
So far I have it set to perfectly do 2 of these 3 things: the camera is placed above the camera subject, and it rotates around it. But it only rotates on a horizontal plane, facing forward flat on that plane.
Im trying to get it to pitch downwards on the camera subject while also rotating in a circle. Imagine, if you have ever played Call of Duty, the predator missile screen before you launch the predator missile. Something like that, where the camera circles around the area and faces downward towards it.
script.Parent.Rotating.Value=true local NewThread=coroutine.create(function() repeat wait() camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 10, 40) --Move the camera backwards 5 units angle = angle + math.rad(1) until script.Parent.Rotating.Value == false end) coroutine.resume(NewThread) |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 01:49 PM |
| Bump. I realize this is advanced, dealing with scripted camera angles and whatnot, but would still appreciate any insight anyone might have, because I have no knowledge at all with this stuff. Google didn't turn up much either. |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
| |
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
| |
|
|
| 07 Sep 2014 02:54 PM |
script.Parent.Rotating.Value=true local NewThread=coroutine.create(function() repeat wait() camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(1, angle, 0) --Rotate by the angle * CFrame.new(0, 10, 40) --Move the camera backwards 5 units angle = angle + math.rad(1) until script.Parent.Rotating.Value == false end) coroutine.resume(NewThread) |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 03:03 PM |
| With this modification, the camera sweeps up and downward as it rotates. It is still focused on the part, still rotating, but it's now moving upward and downward on the y axis as it rotates. Not what I wanted. I'm trying to get it to simply point downward at the object as it around it from a higher position. Thanks for the attempt though. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 03:07 PM |
It shouldnt go up and down... anyway, did you even define angle at any point?
It's set to fix at one point, idk why it wouldnt.. something like this
script.Parent.Rotating.Value=true local NewThread=coroutine.create(function() otherthing = 1 repeat wait() camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(otherthing, angle, 0) --Rotate by the angle * CFrame.new(0, 10, 40) --Move the camera backwards 5 units angle = angle + math.rad(1) otherthing = -otherthing until script.Parent.Rotating.Value == false end) coroutine.resume(NewThread) |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 03:09 PM |
Silly me! I had left out part of my code...
The whole thing was this, originally:
script.Parent.Rotating.Value = true local target = workspace.Spawn.Part local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CameraSubject = target local angle = 1
local NewThread=coroutine.create(function() repeat wait() camera.CoordinateFrame = CFrame.new(target.Position) --Start at the position of the part * CFrame.Angles(0, angle, 0) --Rotate by the angle * CFrame.new(0, 10, 40) --Move the camera backwards 5 units angle = angle + math.rad(1) until script.Parent.Rotating.Value == false end) coroutine.resume(NewThread)
|
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 03:11 PM |
| "script.Parent.Rotating" is a BoolValue, in case you were wondering. |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 07 Sep 2014 03:17 PM |
Yeah, and unfortunately with that last code CrescentJade, the camera spazzes out wildly and faces backwards then forwards every time the fuction uses wait().
Bump fouuuuuur |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
| |
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
| |
|
| |
|
newslate
|
  |
| Joined: 10 Jun 2014 |
| Total Posts: 217 |
|
|
| 11 Sep 2014 04:21 PM |
You can start by doing this.
camera.CoordinateFrame = target.CFrame
DOES THIS MEAN THAT YOU CAN ROTATE THE PART? YES. |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 11 Sep 2014 04:26 PM |
camera.CoordinateFrame = CFrame.new(target.Position)
It's already in the script... |
|
|
| Report Abuse |
|
|
newslate
|
  |
| Joined: 10 Jun 2014 |
| Total Posts: 217 |
|
|
| 11 Sep 2014 04:29 PM |
camera.CoordinateFrame = target.CFrame major difference, this includes the part's rotation. Yours is just the position in which the part is. |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 11 Sep 2014 04:32 PM |
| The rotation of the part doesn't matter to me at all. I don't want the part to be rotated, in fact. In this case, the target is the floor of an entire room. The camera rotates easily around the part without worrying about the part's position, or the part rotating in the first place. I want the camera tilted down as it rotates. Not the part rotating, and the camera looking at it from a fixed position, swinging around. |
|
|
| Report Abuse |
|
|
newslate
|
  |
| Joined: 10 Jun 2014 |
| Total Posts: 217 |
|
|
| 11 Sep 2014 04:33 PM |
| That's why one would tilt the part down.. |
|
|
| Report Abuse |
|
|
Jake0128
|
  |
| Joined: 09 Aug 2013 |
| Total Posts: 1631 |
|
|
| 11 Sep 2014 04:34 PM |
| Tilt the floor of my room? |
|
|
| Report Abuse |
|
|
newslate
|
  |
| Joined: 10 Jun 2014 |
| Total Posts: 217 |
|
|
| 11 Sep 2014 04:35 PM |
| Using the floor as the "subject" is horrible. Create an invisible part or something and tilt that. |
|
|
| Report Abuse |
|
|