#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Have any way can let actor move around the rectangle?

Posts: 201Member, PRO
edited March 5

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.

• Posts: 11,312Member, Sous Chef, PRO, Senior Sous-Chef
edited March 5

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

• Posts: 164Member, PRO

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

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

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:

• Posts: 201Member, PRO
edited March 6

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