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

It looks like, there is no way around. Some of these examples show also "AddComponent" which isn´t that good, performancewise. Global sendEvent requires a second script, and so on...So i have to say, the other VS´s get it working, somehow. Believe me, or not, it can´t be only magic, there is more .

I did some investigation and GameFlow is adding components to forward MonoBehaviour events (MouseDown, Collisions etc.) to scripts on other objects. They just add these components automatically and hide them in the Inspector. So behind the scenes, you're still doing Add Component etc. You just don't need to worry about setting it up. I'm sure other VS systems are doing the same thing - it's really the only way to get these MonoBehaviour events (AFAIK).

I've been playing around with adding this feature to TriggerEvent, CollisionEvent etc. and hope to have it in the next update. We already do a lot of pre-processing at build time to avoid un-needed Monobehaviour event overhead and Add Component costs at runtime, so we should be able to expand that system to handle events on other GameObjects while minimizing performance costs.

You are really sure, it is working this way (add comp.)in GF ? I don´t know if this is the right way, doing it in PM, because of performance. But on the other hand, i have to say, a clean structure is the most important thing in a big project, using a VS system. Otherwise the overview get broken, get spaghetti and so on.

nice to hear that. Will be curious how the workflow will be. Is it planed to be, lets say, in the next release 1.8.6 ?

One last thing:please add "multi object targets" into it. So usually you are able to put only "ONE" object into the target-slot. This is also a big downside. Please update this to be able to put as many target-objects as you want into the event. Thanks !!!