Hi guys, I am trying to determine the previous frame position of a node. I checked the forum and it seems that in _process(delta) function I must first record the current position and then after I move the node record the new position. The problem is that they are always the same. The code looks something like this: print(vel) ....... vel = (target.position - position).normalized() vel = move_and_slide(vel*speed) print(vel) So the node is moving, but every frame I get both values for vel the same. I suppose this is something quite simple, but I can't figure it out.

You can just save the position in a variable.. Also, you are normalizing the velocity. So if the angle hasn't changed, the velocity vector will always be the same.

Hi cybereallity, thank you so much for the answer. I did tried with a variable, and I did tried to simply track the position.x, which is the one that I am interested of, nothing changes, the postion.x in the _process(delta) function is the same before and after move_and_slide function. Why is that?

Not sure. Maybe if you share more of your code I could take a look.

2 years later