Confusion about trying to make a Motor6D face a Head to another player's Head

I’m having issues trying to mess with the neck’s Motor6D settings to get it to look at the closest player’s head on the team “Human”. I’m making a fan-made combat system for Infectious Smile (if you have heard of that game).

CFrames have a built in operation to face from point A to point B

local PointA : Vector3 -- The Motor6D's parent
local PointB : Vector3 -- Whatever you want it to look at
Weld.C0 = CFrame.new(PointA, PointB) -- You may also need to tweak some angles, for example:

Weld.C0 = CFrame.new(PointA, PointB) * CFrame.Angles(0, math.rad(90), 0) -- Example axis adjustment, mess around with it until you get it how you like
1 Like

It should be THAT simple? LOL. I was trying to use something extremely complicated. Maybe I can see how this works later.

You should use CFrame.lookAt instead of CFrame.new for rotation.

Does CFrame.lookAt work for Motor6Ds?

Its still CFrame. There is no difference except being a little faster, newer, and the old method is deprecated.

1 Like

Hey, this helped me sort of figure out what I was supposed to do. I’ll try to get it to work with how I coded it. Definite solution for now from your guys’s help. ^^

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.