-
What do you want to achieve?
This is a reupload of an article that was unsolved. Since then there have been some improvements, the current issue is the Npc’s are able to orientate to the target’s position but its arms are positioned wrong. This Npc is an R15 rig and uses an animation when trying to change its Cframe. So since this Npc is a R15 rig, I was unable to use the method I did for the Npc’s head. -
What is the issue? Include screenshots / videos if possible!
Video with character’s arms repositioned wrong.
Video with character’s arms positioned correctly, and does not follow while target is anchored. (Video 1)
Video 2
- What solutions have you tried so far?
This is one of the solutions that repositions the character’s arms wrong
while true do
task.wait()
local goalCF = CFrame.lookAt(Head.Position, target.PrimaryPart.Position, upperTorso.CFrame.UpVector)
neckJoint.C0 = worldCFrameToC0ObjectSpace(neckJoint,goalCF)
leftMotor6.C0 = CFrame.new(CFrame.lookAt(leftMotor6.C0.Position,Vector3.new(root.Position.X,target.PrimaryPart.Position.Y,root.Position)).LookVector)*CFrame.Angles(math.rad(target.PrimaryPart.Position.Y), 0, 0)
rightMotor6.C0 = CFrame.new(CFrame.lookAt(rightMotor6.C0.Position,Vector3.new(root.Position.X,target.PrimaryPart.Position.Y,root.Position)).LookVector)*CFrame.Angles(math.rad(target.PrimaryPart.Position.Y), 0, 0)
end
This is a solution that positions character’s arms correctly, but does not orientate properly
runService.Heartbeat:Connect(function()
leftMotor6.C0 = CFrame.new(leftMotor6.C0.Position) * CFrame.Angles(-workspace.Zombie.UpperTorso.CFrame.LookVector.Y, 0, 0)
rightMotor6.C0 = CFrame.new(rightMotor6.C0.Position) * CFrame.Angles(-workspace.Zombie.UpperTorso.CFrame.LookVector.Y, 0, 0)
headMotor6.C0 = CFrame.new(headMotor6.C0.Position) * CFrame.Angles(-workspace.Zombie.UpperTorso.CFrame.LookVector.Y, 0, 0)
end)