Have any way can let actor move around the rectangle?

Member, PRO Posts: 215
edited March 2018

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.

• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926
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.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

• Member, PRO Posts: 458

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

• ImagineLabs.rocks Member, BASIC Posts: 5,660

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:

• Member, PRO Posts: 215
edited March 2018

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

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