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 » Scripters
Home Search
 

Re: Making a camera face a part?

Previous Thread :: Next Thread 
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
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 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
12 Apr 2015 12:09 PM
[ Content Deleted ]
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
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
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
12 Apr 2015 12:12 PM
Bust.. It doesn't point directly at my selected part. Just the direction of the part.
Report Abuse
CrazyBananaMonkey is not online. CrazyBananaMonkey
Joined: 10 Nov 2009
Total Posts: 1599
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
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
12 Apr 2015 12:30 PM
[[I dunno what "p"]]

"CFrame.p == Position"
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
12 Apr 2015 12:38 PM
lookvector
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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