Aligning in 1 axis only

For the life of me I can’t figure out the CFrame shenanigans to have a character align their body in Y axis of rotation only.
CFrame.new(HumanoidRootPart.Postion,Part.Position) Does not work for obvious reasons. Ive even messed around with the :toEularAngles() with no luck. Anyone got any ideas?

Goal is kinda like this pic:

4 Likes

Position + rotation:

CFrame.new(
   HumanoidRootPart.Position,
   Vector3.new(
      Part.Position.X,
      HumanoidRootPart.Position.Y,
      Part.Position.Z
   )
)

Just rotation:

CFrame.new(
   Vector3.new(),
   (Part.Position - HumanoidRootPart.Position) * Vector3.new(1,0,1))
)
19 Likes