Hey everyone, I’m new to Defold so I’m just working my way through basic stuff before moving onto actual projects.
Right now I’m trying to move a “player” game object to a target position defined in self.target
. Basically I’m trying to make the player move to where I tap.
Both the position and self.target
are vectors, and I don’t know much vector math or trigonometry at all, so I’m struggling to find any kind of possible solution to this. I’m aware of go.animate()
, but I need the player to move at a constant speed rather than defining a duration for a tween, hence why I’ve turned to vector math.
What would be the solution to this? Do I need to use vector math, or does Defold have a function I can use for this? If the answer is vector math, can you explain how the math works?
Any help is appreciated.