I have some code to move a kinematic body 2d along an AStar path,
the body is provided with the path points as a Vector3 which is how AStar handles them.
I would expect the character to move to the right, however it pretty much always looks off in the wrong direction and heads towards the top left corner.
What am i doing wrong...
var moveSteps = [Vector3(60,0,120),[Vector3(90,0,120),[Vector3(120,0,120),[Vector3(150,0,120),[Vector3(180,0,120),[Vector3(210,0,120)]
var nextMoveStep = Vector3(30,0,120)
var pos = nextMoveStep
var vel = Vector2(1,0)
var posV2 = Vector2(pos.x,pos.z)
print("to Pos: "+str(posV2))
var rot = rotation
vel = vel.rotated(rot)
vel = vel * speed