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?
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
.
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
Oop, I must have mistakenly believed a rumor among devs
I was incorrect, they will not be deprecated. However, they are legacy, meaning they don’t get updated anymore.