i tried making a npc that would look at you during combat, but he always looks the same way, I used BydoGyro and this is how the script works;?
q = script.Parent:findFirstChild("BodyGyro") if q then else z = Instance.new("BodyGyro") z.Parent = script.Parent z.maxTorque = Vector3.new(40000,1,40000) z.P = 40000 z.D = 5000 z.cframe = CFrame.new(script.Parent.Position,Part.Parent.Torso.Position) end
any tips/help is appreciated! Thanks!
Try this, I'm not sure if it'll work, basically it gets the looking direction of the player and inverts it so that the NPC will hopefully face the player. Please let me know if this does NOT work, give a rep and mark as answered if this works! Thanks!
q = script.Parent:findFirstChild("BodyGyro") if q then else z = Instance.new("BodyGyro") z.Parent = script.Parent z.maxTorque = Vector3.new(40000,1,40000) z.P = 40000 z.D = 5000 z.cframe = CFrame.new(CFrame:inverse(CFrame.lookVector(script.Parent.Position,Part.Parent.Torso.Position))) end