Model not moving in certain direction

I have a spotlight model that looks at the cursor, where the arm is only set to follow on the x-axis, and the arm should move on the x and y-axis (looking up and down).

But, I can only seem to get the head of the spotlight to move on the x-axis, and not the y-axis (not the arms holding it, the head of the spotlight).

As you can see, it doesn’t move up or down, but it does move with the arm holding the head of the spotlight.

Mouse.Move:Connect(function()
	local MousePosition = Mouse.Hit.Position
	local direction = Vector3.new(MousePosition.X,Head.WorldPivot.Position.Y,MousePosition.Z)
	Head:PivotTo(CFrame.new(Head.WorldPivot.Position, direction))
end)

Any way to make it also go up and down while moving on the x-axis?

You are telling it to look at the same Y value as it is at.

Do this instead:

Head:PivotTo(CFrame.new(Head.WorldPivot.Position, MousePosition))

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