Using AngularVelocity Constraint to Face a Point

Hello, I’ll be concise here.

I’m looking to have an NPC face a player, using AngularVelocity.
Using input from the current CFrames of both the player and the NPC, how would I go about doing this?

Why would you want to use an angularvelocity when you can use a bodygyro instead?

With a bodygyro you could also tweak the maxtorque and P values to reach a desired result

BodyGyro is a legacy body mover that is soon to be deprecated, and will instead become a property of BasePart.

And, I would like to note I just found a solution. See my following code bit:

local VelBase = MyCF.LookVector:Cross((Pos - MyPos).Unit).Unit

MyCF is the CFrame of the enemy’s HumanoidRootPart, MyPos is the position of that, Pos is the target position.

This is updated every RunService.Heartbeat.

2 Likes

If you have alot of enemies it might be better to just use an alignposition object instead, I haven’t read much up on it though just heard it’s like bodygyro.

Also if you don’t mind can you send me the documentation that bodygyro is getting deprecated? i want to read up on it a bit more

1 Like

Oop, I must have mistakenly believed a rumor among devs :stuck_out_tongue:

I was incorrect, they will not be deprecated. However, they are legacy, meaning they don’t get updated anymore.

1 Like