Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PolyMad on September 06, 2021, 04:58:43 PM

Title: Collision Event with multiple objects
Post by: PolyMad on September 06, 2021, 04:58:43 PM
Collision Event only has space for a single object, what if I need to store more than one collision event?
I mean, surely it doesn't happen so often that an object collides with 2 at the same time in the same frame, but it does happen, and what if in my case this happens quite often?
I need to know if my object is in contact with other 2 objects, how to do this?
Title: Re: Collision Event with multiple objects
Post by: ch1ky3n on September 07, 2021, 06:53:28 AM
I don't think it is possible the collision happens at the "same time" and cancel the others. It still has the queue of which is first but it happens at the same frame of course. Thus, giving you the last entry.

to get all entries, add each information to an array. then, every object enters will be indexed under the array
Title: Re: Collision Event with multiple objects
Post by: djaydino on September 07, 2021, 07:33:01 AM
Hi.
You could do something like a boxcast

i also have a action from array maker that lists game objects inside collider.
But not sure if it works for colliders or only triggers.

I have added the script in the attachment but you need to have array maker installed, else you get errors.

I have also added the array maker package but only use if you don't have it installed yet.

Also make a backup if you install ArrayMaker Package just ot be sure that you can revert (if you get errors you can also share here and i can see if you need some ohter package as well, like Utils for example)
Title: Re: Collision Event with multiple objects
Post by: PolyMad on September 08, 2021, 04:45:41 AM
Thank you!!!