Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a player face towards something? [closed]

Asked by
UPumpkin -34
5 years ago

Would I use body gyro?

Basically I just want it so the player is facing towards a part. Idk where to start though

0
head:Twist() LMAO jk greatneil80 2647 — 5y
0
This isn't a request site green271 635 — 5y

Closed as Not Constructive by green271, Azmidium, DeceptiveCaster, theking48989987, and zblox164

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 5 years ago

You would have to use CFrame of the HumanoidRootPart

This is the construct we're going to use: https://gyazo.com/c916627e2886380c62cf6316b40a36dd

humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart") --Example
targetPart = workspace.Part --Example

humanoidRootPart.CFrame = CFrame.new(humanoidRootPart.Position, targetPart.Position)

Hope this helps!

Link to CFrame for reference:

http://wiki.roblox.com/index.php?title=CFrame

1
there really isn't a reason to use global variables here, but ok DeceptiveCaster 3761 — 5y
Ad