#Unable to rotate the npc with align orientation

1 messages · Page 1 of 1 (latest)

dawn bramble
#

I have tried to use one attachment mode and still doesn't work. I really have no clue how to make it work!
The npc does rotate after like 5 seconds. Any help would be appreciated!

    local alignOrientationPlayer = Instance.new("AlignOrientation")
    alignOrientationPlayer.Attachment0 =     humanoidRoot:FindFirstChild("RootAttachment")
    alignOrientationPlayer.Mode = Enum.OrientationAlignmentMode.OneAttachment
    alignOrientationPlayer.Responsiveness = 100
    alignOrientationPlayer.MaxTorque = math.huge
    alignOrientationPlayer.Parent = humanoidRoot
    alignOrientationPlayer.CFrame = CFrame.new(playerPos, npcPos)
    alignOrientationPlayer.Enabled = false    
    alignOrientationPlayer.Enabled = true
    
    local alignOrientationNPC = Instance.new("AlignOrientation")
    alignOrientationNPC.Mode = Enum.OrientationAlignmentMode.TwoAttachment
    alignOrientationNPC.Attachment0 = npcRoot:FindFirstChild("RootAttachment")
    alignOrientationNPC.Attachment1 = humanoidRoot:FindFirstChild("RootAttachment")
    alignOrientationNPC.RigidityEnabled = true
    alignOrientationNPC.Responsiveness = 100
    alignOrientationNPC.MaxTorque = math.huge
    alignOrientationNPC.MaxAngularVelocity = math.huge
    alignOrientationNPC.Parent = npcRoot
    alignOrientationNPC.CFrame = CFrame.new(npcPos, playerPos)