playMaker

Author Topic: How to apply gravity to more than 100 objects in an array at once.[SLOVED]  (Read 921 times)

playmakertester

  • Full Member
  • ***
  • Posts: 211
Right now, we have more than 100 objects in Array. Those objects are not currently gravitational, but we want to apply gravity to all of them after they collide with an object.

Use Gravity would be fine, but there are more than 100 objects and it's hard.

Please let me know if you have any good actions.
« Last Edit: September 23, 2020, 11:14:22 PM by playmakertester »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How to apply gravity to more than 100 objects in an array at once.
« Reply #1 on: September 23, 2020, 12:06:59 PM »
Hi.
Use array get next and loop thru the list.

so state 1 :
Array Get Next
set the variable as game object (call it 'Current Object' for example)

and transition next to state 2
also transition Done to a state (this event will be send when the action has looped thru its list)

state 2:
Do use Gravity on the 'Current Object'

transition back to state 1

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to apply gravity to more than 100 objects in an array at once.
« Reply #2 on: September 23, 2020, 12:51:56 PM »
Hi djaydino!

It worked perfectly!
Thank you so much!

By the way, I'd like to enable Collider as well as Gravity, please let me know if you have a good Action.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How to apply gravity to more than 100 objects in an array at once.
« Reply #3 on: September 23, 2020, 01:56:14 PM »
Hi.
I think you should find 'enable Collider' on the Ecosystem

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to apply gravity to more than 100 objects in an array at once.[SLOVED]
« Reply #4 on: September 24, 2020, 12:52:21 AM »
It worked perfectly!
Thank you!