How do I make Gravity Towards any object

Get help using Construct 2

Post » Wed Oct 19, 2016 8:24 am

I have one large circle and some tiny circles I want to fall tiny circles towards large circle
How this possible to do ???
Please help
Image
B
74
S
44
G
48
Posts: 700
Reputation: 34,742

Post » Wed Oct 19, 2016 8:32 am

I think you can use the physics behaviour?

https://www.scirra.com/manual/98/physics

Edit:

Apply force towards position might be what you're looking for.
Follow my progress on Twitter
or in this thread Archer Devlog
B
43
S
18
G
19
Posts: 1,065
Reputation: 14,089

Post » Wed Oct 19, 2016 8:42 am

tunepunk wrote:I think you can use the physics behaviour?

https://www.scirra.com/manual/98/physics

Edit:

Apply force towards position might be what you're looking for.


but this only moves object toward big circle once and then fall to down
i do not want to fall it down
big circle is like earth
Image
B
74
S
44
G
48
Posts: 700
Reputation: 34,742

Post » Wed Oct 19, 2016 12:35 pm

You can do this using the physics behavior (for the large and small circles).
First set a condition to turn off gravity
At beginning of layout -> Big Circle set Physics World Gravity to 0.

And then apply forces to each small circle
each tick -> Small Circle apply force towards position ( force, BigCricle.X, BigCricle.Y, Image point 0)
B
29
S
10
G
10
Posts: 97
Reputation: 6,614


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests