|
| 12 Apr 2015 12:04 PM |
I'm created a script that locks it's Coordinate Frame to a certain spot, and it's Subject, and it's focus onto the Characters HumanoidRootPart.
My problem is, it's not actually pointing at the Part. It's facing the direction of the part, but the Camera is set Higher then the part so the part I am viewing is much lower then the Camera. What's the command to actually get it to point. Where going for a part that is lower then the camera, so the Camera needs to be pointed down.
Here's the script. At least part of it. The rest holds no value to this problem.
C.CameraType = "Scriptable" C.CoordinateFrame = CFrame.new((Character.HumanoidRootPart.Position.X), (Character.HumanoidRootPart.Position.Y + 20), (Character.HumanoidRootPart.Position.Z + 25)) C.CameraSubject = Character.HumanoidRootPart C.Focus = CFrame.new(Character.HumanoidRootPart.Position.X, Character.HumanoidRootPart.Position.Y - 15, Character.HumanoidRootPart.Position.Z)
Calling all geniuses. |
|
|
| Report Abuse |
|
|
murcury57
|
  |
| Joined: 30 Jun 2010 |
| Total Posts: 90299 |
|
| |
|
|
| 12 Apr 2015 12:11 PM |
This is what I have fully. I'm going to try what you posted now.
local Player = script.Parent.Parent.Parent --This script is in a Gui in the PlayerGui local Character = workspace:WaitForChild(Player.Name) local C = workspace.CurrentCamera local runService = game:GetService("RunService")
local Delay = true
runService.RenderStepped:connect(function() C.CameraType = "Scriptable" C.CoordinateFrame = CFrame.new((Character.HumanoidRootPart.Position.X), (Character.HumanoidRootPart.Position.Y + 20), (Character.HumanoidRootPart.Position.Z + 25)) C.CameraSubject = Character.HumanoidRootPart C.Focus = CFrame.new(Character.HumanoidRootPart.Position.X, Character.HumanoidRootPart.Position.Y - 15, Character.HumanoidRootPart.Position.Z) |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 12:12 PM |
| Bust.. It doesn't point directly at my selected part. Just the direction of the part. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 12:21 PM |
CFrame can be used to set the position and what it looks at, like this: CFrame.new(Position in Vector3, Focus in Vector3)
Camera.CoordinateFrame = CFrame.new(Camera.CoordinateFrame.p, part.Position) |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 12:29 PM |
I dunno what "p" is, but it works! Your an angel, you know that?
I wish there was something more I could do then just say thanks. But you have my thanks. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 12 Apr 2015 12:30 PM |
[[I dunno what "p"]]
"CFrame.p == Position" |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
| |
|