Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: playmakertester on September 23, 2020, 11:46:25 AM

Title: How to apply gravity to more than 100 objects in an array at once.[SLOVED]
Post by: playmakertester on September 23, 2020, 11:46:25 AM
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.
Title: Re: How to apply gravity to more than 100 objects in an array at once.
Post by: djaydino 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
Title: Re: How to apply gravity to more than 100 objects in an array at once.
Post by: playmakertester 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.
Title: Re: How to apply gravity to more than 100 objects in an array at once.
Post by: djaydino on September 23, 2020, 01:56:14 PM
Hi.
I think you should find 'enable Collider' on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
Title: Re: How to apply gravity to more than 100 objects in an array at once.[SLOVED]
Post by: playmakertester on September 24, 2020, 12:52:21 AM
It worked perfectly!
Thank you!