Apply Different Gravity In Various Areas Of The Screen

Good Afternoon!

I wonder if you can apply different gravity in different areas of the display …

Can help me? :S

Thank you,

Tiago Eirinha

Hello Tiago,

The best solution for this would be to set up various sensors (invisible physical objects configured as sensors). Then, set up a collision routine so that any object that moves inside one of these regions has its “gravityScale” property modified. Here are some references for you:

http://docs.coronalabs.com/api/type/Body/gravityScale.html

http://docs.coronalabs.com/api/type/Body/isSensor.html

http://developer.coronalabs.com/content/game-edition-physics-bodies

http://developer.coronalabs.com/content/game-edition-collision-detection

Hope this helps!

Brent Sorrentino

Hello Tiago,

The best solution for this would be to set up various sensors (invisible physical objects configured as sensors). Then, set up a collision routine so that any object that moves inside one of these regions has its “gravityScale” property modified. Here are some references for you:

http://docs.coronalabs.com/api/type/Body/gravityScale.html

http://docs.coronalabs.com/api/type/Body/isSensor.html

http://developer.coronalabs.com/content/game-edition-physics-bodies

http://developer.coronalabs.com/content/game-edition-collision-detection

Hope this helps!

Brent Sorrentino

Hi Brent!

Thanks for the help…

Tiago Eirinha

Hi Brent!

Thanks for the help…

Tiago Eirinha