I am making a tower defence game and this is what has happened. The code is all right but it looks funny cause the feet are sunken. All the math is fine.
OverallDistance = ((GetNode(EnemyData.Node - 1, EnemyData.Path).End.Position - GetNode(EnemyData.Node, EnemyData.Path).Position) * Vector3.new(1, 0, 1)).Magnitude
Distance = OverallDistance - (((GetNode(EnemyData.Node, EnemyData.Path).Position - EnemiesActive[EnemyData.EnemyHash].PrimaryPart.Position) * Vector3.new(1, 0, 1)).Magnitude)
return Vector3.new(0, YOffsetHelper(GetNode(EnemyData.Node - 1, EnemyData.Path).End.Position.Y, GetNode(EnemyData.Node, EnemyData.Path).Position.Y, Distance / OverallDistance) + EnemyData.YOffset + GetNode(EnemyData.Node - 1, EnemyData.Path).End.Position.Y, 0)
The white part is the node