Have any way can let actor move around the rectangle?

WeiyuWeiyu Member Posts: 216
edited March 2018 in Community Tutorials

I have a problem about how to let actor move around the rectangle ?

I know Gamesalad can use "cos(angle)" and "sin(angle)" to move in circle.
On the other hand, have any way can let actor move around the rectangle?
Thank you. :)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2018

    The Move behavior allows for any degree from 0 to 360. So yes, you can specify movement in 90° amounts.

    Since you mentioned cos and sin, I'm guessing you want automatic movement "around the rectangle." You could do this with a few Timers, I suspect.

  • Twayne2Twayne2 Member Posts: 458

    How can you make an actor move in a circle using sin and cosine? I am just curious. :smile:

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    One way to do this would be to use waypoints, I've attached a quick demo. I also have a more detailed tutorial on the concept if you want to check it out:

  • WeiyuWeiyu Member Posts: 216
    edited March 2018

    This is very useful advice and tutorial video.
    Thanks for your kindly help, I really appreciate it. :D

    you can constrain self.position.x to A * cos(self.time*B )+C
    and constrain self.position.y to A * sin(self.time*B )+C

Sign In or Register to comment.