Hey everyone, I’ve been having some trouble on this little project I’ve been working on. I am new to Lua and mobile game designing in general, but that isn’t the issue on hand. What I’m trying to accomplish is a waypoint system, the best example I could give would be like a tower defense game. The enemies move on a certain path or to waypoints. I have my arrays.
wp\_x = { 20, 40, 60, 80, 100 }
wp\_y = { 100, 80, 60, 40, 20 }
I have tried a few if statements, they don’t work they way I want, this is what I’ve tried.
if enem.x = wp\_x[1] then enem.x = wp\_x[2]
Ect. I had my doubts with that, because of the fact I pretty much knew it wouldn’t show my entity moving to that coord.
I have also tried transition.to, this was my code.
transition.to(enem, { time = 2500, wp\_x[2], wp\_y[2] })
Which did nothing at all. Any ideas? Thanks. [import]uid: 45981 topic_id: 7941 reply_id: 307941[/import]