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

How do I make the player face the Camera's Focus?

I'm looking to make a script that is just like the Shift Lock, except the player is located in the center as normal. Can someone take me through the process of how this is done?

Any comments/answers will help. ~SkeletalReality

1 answer

Well we can either use a bodygyro and CFrame for this, i'd go with bodygyro

BodyGyro create a bodygyro and change its 'cframe'

local position = workspace.CurrentCamera.Focus.p

local bg = Instance.new("BodyGyro")
bg.cframe=CFrame.new(position)
bg.Parent=character.HumanoidRootPart

now you have to take in account that you'll have to change position and update the bodygyro whenever the camera moves

CFrame change the cframe of the model using :SetPrimaryPartCFrame and making the direction the position of focus

local position = workspace.CurrentCamera.Focus.p

character:SetPrimaryPartCFrame(CFrame.new(character:GetPrimaryPartCFrame).p, position)

same thing as the other method these scripts are not complete and you need to update this when the camera moves to the character is always rotated to the focus if thats what you want

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