I've been trying to get this player to point correctly to another player, but it's not working and the player gets flung.

local p = workspace.NPC2.HumanoidRootPart
local root = workspace.NPC.HumanoidRootPart
local bGyro = Instance.new("BodyGyro") -- http://robloxdev.com/articles/BodyMover#bodygyro
bGyro.CFrame = CFrame.new(root.Position, p.Position) -- Orientation of NPC should point towards NPC2. http://robloxdev.com/api-reference/datatype/CFrame
bGyro.Parent = root

Also when I printed the CFrame it showed the position and then a bunch of "NAN" which shouldn't be there, there should be the Rotational matrix there. Am I doing something wrong with BodyGyro? Kinda new with BodyMovers.

1 comment

0

what is your maxtorque set to? I tried this in my studio with two npcs and it worked fine...if you have multiple bodygyros then the npc may run into some issues