Making the motor6d face the model

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    make the motor6d correctly follow the position of the Dummy(Model) in the x axis

  2. What is the issue?
    the motor6d does not seem to follow the dummy correctly, it wont look at the dummy.
    Here’s a recorded video of the problem

  3. What solutions have you tried so far?
    I have tried using cframe.lookat but that just makes it go to the void

Code:

local tween = game:GetService("TweenService")
local module = require(script.getNearest)
local model = script.Parent
local neck = model.Head.Neck
local nC0 = neck.C0

local tin = TweenInfo.new

while task.wait() do
	local ae = module:getNearbyModels(1000,model:GetPivot().Position,{model})
	
	if ae ~= {} then
		local pos = ae[1]:GetPivot().Position
		tween:Create(neck,tin(.1),{C0 = nC0 * CFrame.new(Vector3.new(0,0,0),pos)}):Play()
	end
end

For Motor6Ds you will need a special formula,

Here is one that will work.

Let me know if you want the other one, currently writing a tutorial on it.

2 Likes

how do i get a certain axis like only the X axis?
(never mind i figured it out)