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

[SOLVED] How would one teleport a part 8 studs in front of where the camera is facing?

workspace.Part.CFrame = workspace.CurrentCamera.CFrame - Vector3.new(0,0,8)

I'm running this code in the command bar in studio. It does it's job, except one thing. It doesn't account for where the camera is looking and I don't know how to make it do so. Basically, I want the part teleported in view of my camera (without having to turn the camera) and 8 studs away.

1 comment

1

you could try using CFrame.lookvector

1 answer

This worked:

workspace.Part.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -8) 

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