playMaker

Author Topic: Trigger problems [SOLVED]  (Read 556 times)

ViRiX Dreamcore

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Trigger problems [SOLVED]
« on: September 30, 2019, 11:08:45 AM »
Hi,

I'm using PlayMaker with Poolboss and am having some trigger proglems. I spawned a certain number of objects and I have a trigger block that moves around that is supposed to erase the spawned objects one by one so the pool doesn't get filled. However, when the trigger touches one object, it erases all of them.

I have confirmed that the despawn action that comes with PoolBoss isn't the problem. I am pretty sure this is a user error of some kind, but I can't figure out what's going on.

Here's a small video where I explain in a bit more detail and you can see what's going on.

Any help is greatly appreciated. Thanks!


« Last Edit: October 02, 2019, 12:50:14 PM by ViRiX Dreamcore »

daniellogin

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: Trigger proglems
« Reply #1 on: September 30, 2019, 11:57:09 AM »
Screenshots would have been better. I can't read any of the settings you have there.

However I only watched the first part where you show a trigger event and then the despawn action and may have spotted something wrong (or not... can't read it).

Anyway, your trigger event stores a collider for the object hit. That gameobject variable is 1 word. In the action to despawn, that gameobject variable is two words. So how does the despawn action know what to despawn? It's not using what the trigger hit. It's using something static.. hence why it's everything?

Anyway, what about doing it a different way.

1) Object with collider
2) Trigger event for that object which stores the collider (what it hits)
3) Send Event to that object hit
4) Each object you want to move has an FSM which idles until it receives the event, at which point it transitions to an action that tells the object to despawn itself

Depending on how your pooling actions work, it may be easier to do it this way because you tell the object to do it to itself and not have to ID the correct target.


ViRiX Dreamcore

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger proglems
« Reply #2 on: September 30, 2019, 04:43:59 PM »
Thanks. Hmm I'll add screenshots as my problem is with the collider. I'm not sure how to get the collider to realize it's only supposed to do something to that object that's hitting it.

The "block01" object has an FSM that says when you enter the trigger tied to the game object variable "vSpawnOut", transition to the action that tells itself (Use Owner) to despawn.

When the game starts, that plane uses an FSM to assign itself to the "vSpawnOut" variable. So one one of the Block01 pieces collides with it, they should despawn, but when one collides with it, they all despawn.

Here's some screenshots.

Second action on the Block01 FSM that despawns object.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15443
  • Official Playmaker Support
    • View Profile
Re: Trigger proglems
« Reply #3 on: October 01, 2019, 04:02:34 AM »
Hi,

 what is in state 1?

Bye,

 Jean

ViRiX Dreamcore

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger proglems
« Reply #4 on: October 01, 2019, 12:25:53 PM »
Here's state 1 of Block01



Here's where the vSpawnOut is defined. It's defined as soon as the game starts.



Here are the settings for the SpawnOut object that vSpawnOut was asigned to at game start.


ViRiX Dreamcore

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Re: Trigger proglems
« Reply #5 on: October 02, 2019, 12:01:53 AM »
Alright, I've got it figured out.

What I did was I switched it so that each block is a trigger and the plane behind them gets ride of them. Kind of like a player collecting coins. Thanks everyone!