0 votes

Hello, I'm having trouble implementing something that sounds simple. So I've got a Sprite node that is outside the window and I also got an Area2D somewhere in the scene. When I click on the Area2D the Sprite will slowly move to the Area2D position. I can achieve putting the Sprite instantly to the position of the Area2D but I can't get it to smoothly move from outside the window to the Area2D position.

Any ideas?

asked Oct 25, 2019 in Engine by Kostas Vasileiadis (12 points)

1 Answer

+1 vote

What you want is "linear interpolation" or lerp().

If you're not familiar with what this is, you can read this introduction in the docs:

Alternatively, you can use a Tween to move the position.


answered Oct 25, 2019 by kidscancode (17,714 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.