playMaker

Author Topic: Problem with multiple List Game Objects Inside Collider in a single state  (Read 2792 times)

paradiseprime

  • Full Member
  • ***
  • Posts: 106
I am trying to use List Game Objects Inside Collider to detect when something is hit. I have multiple in one state because there are different factions of enemies and this was the most efficient way to get all the hitboxes and send events to each. The issue I am having is that only the top List Game Objects Inside Collider works and every other one below it doesnt.

An example would be:
Action1
Tag:Player
Layer: Targetable
Action2
Tag:Demon
Layer: Targetable
Action3
Tag:Animal
Layer: Targetable

They all go to the same array list which is "Targets" so duplicates can be deleted and then events sent to all of the remaining targets in the list. In the example above only "Player" would be detected when all 3 should be detected. I have also tried using individual colliders for each faction that overlap themselves and dont as well as using only 1 collider with the same results.

Anyone know whats the issue?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
Can you show a image on the state with the actions?

paradiseprime

  • Full Member
  • ***
  • Posts: 106
Hi.
Can you show a image on the state with the actions?
https://streamable.com/mpfos
That is a quick video of the state. The errors are there because the array lists are created at start using the name of the weapon so it can be modular.

Thore

  • Sr. Member
  • ****
  • Posts: 480
You look on the owner, and there it expects a list proxy component. Is your dynamic setup really correct?

paradiseprime

  • Full Member
  • ***
  • Posts: 106
You look on the owner, and there it expects a list proxy component. Is your dynamic setup really correct?
Yes its correct.
Its meant to be modular so I can just swap out the model and change the stats with a few key strokes. The setup makes 2 array lists. One is the base array that is unsorted and the other is a copy. The base array is there to gather all of the colliders detected and copies them over to the copy array to be sorted[delete duplicates] then events are sent to each.

With this setup I am able to detect and accurately damage upwards of 40+ enemies at once.https://streamable.com/tqc9v

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
On the 1st video i could see that there are issues with array lists not found.

you need to add a array list component to work with array list.

Here is a video about array lists :


paradiseprime

  • Full Member
  • ***
  • Posts: 106
Hi.
On the 1st video i could see that there are issues with array lists not found.

you need to add a array list component to work with array list.

Here is a video about array lists :


I use create array list to create 2 array lists on start which is why it shows the error but after reading your comment I found you can use the Set Property action to set the reference which gets rid of the error and still does what I want it to do.

This however isnt my issue. If 2 or more List Game Objects Inside Collider actions are in a state then only the top one works. The ones below it dont pick up anything.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Hi.
I looked back the the video again.

the Next Frame event, does it send the 'loop' transition?

if so it should be on the bottom of the list.

but also i noticed the the other actions have every frame active.
if a action is set every frame it will stay in that state and run every frame.

So you do not need 'next frame event' there
OR
Turn off every frame on the other actions, place next frame in the bottom of the action list and you can also set as sequence. (right Click in state window to toggle Sequence)

A state always executes the top action 1st, then the next and so on.
If sequence is turned off, it will not wait until previous Action is finished.

If sequence is turned on it will execute and wait till finished and then go to the next action.

paradiseprime

  • Full Member
  • ***
  • Posts: 106
Hi.
I looked back the the video again.

the Next Frame event, does it send the 'loop' transition?

if so it should be on the bottom of the list.

but also i noticed the the other actions have every frame active.
if a action is set every frame it will stay in that state and run every frame.

So you do not need 'next frame event' there
OR
Turn off every frame on the other actions, place next frame in the bottom of the action list and you can also set as sequence. (right Click in state window to toggle Sequence)

A state always executes the top action 1st, then the next and so on.
If sequence is turned off, it will not wait until previous Action is finished.

If sequence is turned on it will execute and wait till finished and then go to the next action.

Good to know. I removed the next frame event but the issue still persists.
Its like you can only have 1 List Game Object Inside Collider action per state.