playMaker

Author Topic: trigger2D event doesnt detect multiple pieces  (Read 702 times)

TerraImagina

  • Playmaker Newbie
  • *
  • Posts: 33
trigger2D event doesnt detect multiple pieces
« on: March 29, 2020, 04:51:51 AM »
Hi,

I have a bug on a scene and dont know how to fix it.
It is a simple drag and drop mechanic.
Drag a piece "dragelement" on to a GO "goal"  and it should detect a trigger enter to make it bigger.

I made the script in _gameMechanic GO and use on the pieces GO "dragelement" a "get owner" to declare itself as a variable called "currentobjectDrag"
Then I duplicated the GO "dragelement" to have to similar puzzle pieces.

When I test the scene, the first GO I drag react normally and detect the trigger2D event (enter and exit), but the second GO I drag fail to detect anything. (watever the first GO I drag, it will work only on this first GO)
Even if the script recognise the "currentobjectDrag" variable is the current GO I am dragging, it fail to detect its trigger event. Only the first GO dragged will react to trigger2D event.

Did you get this kind of problem or know how to fix it?

Thank you
« Last Edit: April 02, 2020, 02:54:43 PM by TerraImagina »

TerraImagina

  • Playmaker Newbie
  • *
  • Posts: 33
Re: trigger2D event doesnt detect multiple pieces
« Reply #1 on: April 02, 2020, 02:58:30 PM »
Hi,

Just a small bump,
I tryed to fix this issue today but still could not make it work...

I am not sure if the description really help to understand the problem,
In case, I attached the scene, as a prefab.

The mechanic work if each puzzle piece, have a  FSM that detect a trigger enter.
But I wanted to have this script in a single GO "_gameMechanic" and have a get owner to each single puzzle piece... so it is more clean.
Now I am not sure it is doable.