I want move object to point (SOLVED)

#1

I have a trable with vmath, couse it works not i know from unity. So pls help me with move object towards point and after that i need check that it reach the point. I know that i need to use “lerp” but i had a problem with it.

0 Likes

#2

What have you tried so far?

0 Likes

#3

I deleted much variants, but i have this:
But it doesn’t stops.

if self.to ~= nil then
		local to = ToPose[self.to]
		local pos = go.get_position() 
		pos = pos +  to * self.speed * dt
		go.set_position(pos)
		if pos > to then
			self.buisy = false
			self.to = nil
		end
	end
0 Likes

#4

Why not use go.animate()?

2 Likes

#5

thank you

0 Likes