How to create moving platforms?

Hi! I’m new to Defold and trying to make a simple platformer remniscent of Fireboy and Watergirl. I was wondering how you would code a platform so it would move along a set path, either horizontally or vertically? I am totally lost TwT Thank you so much for any help!

Hi, I can only give you the idea of how I would code something like that.

First of all, the platform need a destination. I think, you can use go.property for that , where you give a destination. Also, I think, that it is possible to create some game object “point path” , which you can add to the platform game object in you level. This point path on init must send a “register” message to its parent (platform). This way you will have to receive this message in the platform, but you will always be able to visually see you path’s points and have them as many as you want.
When the platform has its destination, it must start to move. Probably, this logic goes to update, and we need a speed variable. Then you need to calculate a difference between platform’s destination and its position (this gives us a real destination vector), the you vmath.normalize() it and then multiply by speed, dt (available in update()). That way you will have the platform’s delta location. After that you just need to add it to its current location.

I hope, I help you somehow with my thoughts…