Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i use lookVector to point the players camera to a part?

So lets say i have the players camera stuck in one spot using Camera.CoordinateFrame but what if i wanted to point the camera to something? How could i do this?

Also would the camera look to the left with it?

Thanks!

1 answer

✓ Accepted answer

You actually need to use the CFrame constructor that takes two Vector3 values:

--LocalScript

local cam = workspace.CurrentCamera
local camPos = Vector3.new(5, 5, 5) --Example
local target = workspace.Part

cam.CoordinateFrame = CFrame.new(camPos, target.Position)

lookVector is a read-only Value.

1 comment

0

And that constructor is 'CFrame.new(Vector3 position, Vector3 point)'. It creates a CFrame at position, looking at point.

This discussion is preserved as it was. New answers, comments, and votes are closed.