How do I make objects to orbit a center point and follow it

Get help using Construct 2

Post » Sun Dec 21, 2014 10:23 pm

I want to make some objects runs in a circle towards a center point, and if I move the center point, the objects follow it but still running in perfect circle.

How do I achieve this?
Last edited by ekajuan on Mon Dec 22, 2014 3:13 am, edited 1 time in total.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon Dec 22, 2014 1:57 am

The easiest way to do this is to move the center point of the orbiting object outside of its bounding box, then set it's position to the object you want it to orbit. Pin the orbiter, and rotate it.

The problem is if you want to change the orbit distance, you have to take a different approach.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 22, 2014 4:10 pm

I get the picture. Thanks
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon Dec 22, 2014 5:51 pm

@ekajuan you can use Circle behaviour. You can specify a center of rotation using events and also which type of path do you want (circle/elipse)
https://www.scirra.com/forum/behavior-circle_t115947
Another option is to use an invisible object that is rotating and use Pin behaviour to pin the object that you want it to rotate
B
82
S
21
G
23
Posts: 520
Reputation: 18,737

Post » Mon Dec 22, 2014 5:56 pm

Does circle behavior only exist in paid version?
Because in free version there is no circle behavior.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon Dec 22, 2014 6:27 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Dec 22, 2014 7:11 pm

@ekajuan Circle behaviour is a third party plugin. Check the above post for a list of plugins and behaviours. I also recommend MoveTo behaviour..is a life saver if you need sprites moved to certain positions (also having easeIn/Out). A more powerful behaviour that I enjoy is LiteTween. You can make moving objects using elastic movement, bounce, etc. These are the supported types of functions that LiteTween can use http://easings.net/
B
82
S
21
G
23
Posts: 520
Reputation: 18,737

Post » Mon Dec 22, 2014 7:35 pm

Ow great... This is new for me. Thank you for the replies
B
10
S
5
Posts: 220
Reputation: 1,464


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests