playMaker

Author Topic: TriggerEvent - Target Object  (Read 712 times)

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
TriggerEvent - Target Object
« on: August 11, 2017, 04:31:02 AM »
I need a modified "TriggerEvent.cs" which is able to let me choose my target GameObject. Now i am only able to put the FSM onto an object which has a RigidBody or a Collider Component.

This is really anoying, because i have always to take a look, into my hierarchy and it makes my "overview" of the Playmaker States terrible. So please, if anyone can modify the script to got a option to choose your target GameObject, it would be awesome ! Thanks ...

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #1 on: August 11, 2017, 09:24:58 AM »
Hi,
as far as i know this is not possible, it is a unity limitation.
If you would use standard scripts you would need to place them on the object that needs to use a trigger.

What i use regularly is : an fsm on the object with a trigger event' action and then in the next state use a 'send event' action to send a event to a different fsm

Here is a video tutorial about global events and transitions :



djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #2 on: August 11, 2017, 09:55:37 AM »
Hi,
i have updated the action 'Trigger Event 2' on the ecosystem

with this one you can target a send event, so you can do what i said on my last post with a single action in a single state.

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #3 on: August 11, 2017, 09:53:06 PM »
Hey,

thank you very much for invest and the respond ! Glad if it works. Will try i later when i am back home.
As you said, it is not possible. I am not sure, because i have other visualScript tools where this behaviour is possible. Therefore i thought it should be possible with Playmaker as well.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #4 on: August 11, 2017, 11:39:04 PM »
Hi,
which tool is that?
I would love to see how they managed to do so.
Maybe there is a way then to implement it in Playmaker also.

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #5 on: August 12, 2017, 05:13:35 AM »
I use these tools in combo with PM:
- FlowCanvas
- NodeCanvas
- GameFlow

All these have the ability to use ANY object as a target object. I wrote this month ago in the forum:
I have to say, it is a very important function to have something on board, to change the target object. Especially on the trigger event. Because i want to have a nice structure in my Program stack. Otherwise i have to search it in my 2000 Objects in the hierarchy where my trigger FSM is on.

So, please someone add a function to the trigger event, where i can put my desired target object.

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #6 on: August 12, 2017, 05:20:16 AM »
Why do we need that in PM ?
Well, in my opinion it is really important for a good workflow. As described, if you go the standard way, you lose your nice "structure" in the hierarchy. You have to "search" your spreaded FSMs on different objects, really anoying. Sure you can use "sendEvents", but it isn´t an elegant way. And it is not only for the "TriggerEvent". There are some other Actions, that don´t have the ability to select your TargetObject.
« Last Edit: August 12, 2017, 05:21:56 AM by MakerPlay »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #7 on: August 12, 2017, 06:56:04 AM »
Hi,
From what i can see in the few videos available on nodeCavas and on GameFlow

the trigger events are also on the trigger object and also using Tags

On game flow you need to drag 'other' in Tag/Of
Other is a result of what entered the trigger and then it will check the tag if it is equal.

Also nodecavas works the same.

What actions do you mean that don't have the ability to select your TargetObjects?

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #8 on: August 12, 2017, 09:58:48 AM »
In GameFlow for instance, you don´t need to make any Tags / Layers to your desired Objects. Simply Put the TargetObject into the Slot. Thats it !!! It is really a dream :-) (its n old video. You don´t need to put it on the active object)

I don´t know how it internaly works. But you as the user, don´t have to hassle with anything. Just put all things together, and it works perfectly. It is a enourmusly benefit for the whole workflow / speed.

Not only TriggerEvents in PM are working this old-fashion way. Also CollisionEvents. And many others don´t have the ability to select the TargetObject as above described. Sadly ! Many new / other VisualScripts have the ability to put events on any objects (for a nice structure) and you can put also as many objects as you want into the slot of the TargetObject.
« Last Edit: August 12, 2017, 10:08:53 AM by MakerPlay »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #9 on: August 12, 2017, 09:28:03 PM »
Hi,
Can you reference a new video?
or make a video showing this?

I think i can make something similar,

from what you explain (under the hood) the trigger gets the object and compares the object(s) you inserted

But the action  still needs to be on the trigger object.

If you can show me how GameFlow uses trigger source from another object
maybe i can find out how to do it.

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #10 on: August 13, 2017, 06:16:28 AM »
You don´t believe me, huh  :D

I am not a Unity-Tech to know this restriction "...action still needs to be on a trigger object". Sounds a bit lame, to be honest, from the unity-side. Somehow the Devs of these other VS´s get it working.

I will try to make some Pics, maybe videos. So you will see, that it works flawlessly. I am not sure, if i can show how it uses trigger-source from another object (i guess everything is under the hood).

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #11 on: August 13, 2017, 06:47:40 AM »
This is how it works:


Can you get the idea of it ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2305
    • View Profile
    • jinxtergames
Re: TriggerEvent - Target Object
« Reply #12 on: August 13, 2017, 07:29:13 AM »
Hi,
I believe you :D
i just could not find any sample/video that shows this (for research purpose)  :)

It is indeed lame from unity that it has to be on a trigger/collider object...
This unity answer is explaining that you can't trigger directly from another object
http://answers.unity3d.com/questions/867859/how-to-detect-ontriggerenter-on-another-gameobject.html

When you play the game, does it add some component on the source object from the trigger? (the "in GameObject")
I think it is doing so and that makes me wonder performance wise especially when instantiating (creating) new object with triggers while playing the game.

I can let you in on a secret that PlayMaker is investigating this.
(This does not mean that it will become available.
But if it is possible without performance loss, there is i chance that it will be included in a next update.)

MakerPlay

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: TriggerEvent - Target Object
« Reply #13 on: August 13, 2017, 08:28:17 AM »
I am not sure if this is an unity employee  :D ...If it is, it seems he doesn´t have many understandings of how internal stuff works.

Again, you don´t believe me  ;D . Nothing is added during the play. C´mon man  ;) . (just kidding around) So performance is: top ! Everything works as it should. I know, it sounds like magic. Maybe it is. Or unity has internal many secrets.

You really think, PM is doing something ? I am a long time user of PM. Don´t missunderstand me, i love PM, because of those many actions it has. But after 4 years NOTHING changed UI wise, workflow wise. Main TargetGroup of PM, are non coders, designers. Therefore it is really important to improve Ui & workflow time by time. Not only updating some actions (community is allready doing this).
This is why i also trying and buying other VS´s systems. For me, there are many lacks that should be improved. So, if it is true, what you are saying, i buy PM again. But hard do believe. Enough trash-talk. PM is the 1st tool, how i get in touch with unity ! Therefore i am loyal to it.

So if you, or anyone else is willing / has time to modd the "TriggerEvent.cs", it would be great. Otherwise i have to wait, or use other tools. Thx you very much, for explaining some things, investigating your time :)
« Last Edit: August 13, 2017, 09:04:12 AM by MakerPlay »

tcmeric

  • Sr. Member
  • ****
  • Posts: 480
    • View Profile
Re: TriggerEvent - Target Object
« Reply #14 on: August 13, 2017, 08:30:25 PM »
Hi, I will also chime in here. I also researched this problem lately, as I was writing custom playmaker actions for ragdoll (which also uses collision events). Unfortunately as djaydino mentioned, you do need to have the trigger events on the actual game objects currently.

Basically the only way around it is to have a second script listening for the event to happen.

Honestly this sucks. Its too bad Unity designed it this way.  :'(  :'(  :'(

You can see replies about it here:

http://answers.unity3d.com/questions/486214/ontriggerenter-on-seperate-object-than-the-script.html

http://answers.unity3d.com/questions/986235/is-it-possible-to-check-collision-from-another-obj.html

http://answers.unity3d.com/questions/40434/ontriggerenter-through-a-different-object.html

The easiest playmaker way to handle that at the moment, is to have a global send event. Your right, its not elegant, but is essentially what these examples above are doing (but just with script).
« Last Edit: August 13, 2017, 08:32:23 PM by tcmeric »