Mesh looking to the left instead of forward while lerping

Basically, I want the mesh/part to look in the direction its going in, but, the problem is for one of the things its looking left. Is it a problem with the mesh? or the code.

local lookAtDir = (randomPosition.Position - moveObject.Position).unit
local newPos = current:Lerp(randomPosition, alpha)
moveObject.CFrame = CFrame.new(newPos.Position, newPos.Position + lookAtDir)

4 Likes

The mesh’s front face is likely Right. You can export it to blender and rotate right, but if you don’t want to do that, times the CFrame by an 90 degrees (or -90) until it works.
Like this:

moveObject.CFrame = CFrame.new(newPos.Position, newPos.Position + lookAtDir)
	* CFrame.Angles(0, math.pi/2, 0)
3 Likes

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