playMaker

Author Topic: What causes an event to become Global  (Read 1766 times)

matthutton

  • Playmaker Newbie
  • *
  • Posts: 21
What causes an event to become Global
« on: February 11, 2023, 03:34:25 PM »
I'm trying to avoid using public variables and events. It seems events spontaneously become checked as global. What circumstances causes an even to move from local to public if I never manually check the box?
« Last Edit: February 11, 2023, 03:41:16 PM by matthutton »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: What causes an event to become Global
« Reply #1 on: February 12, 2023, 01:52:58 PM »
Hi.
If the event name you create is already a global event somewhere else, it will automatically be global.

use a different name, do not uncheck global as you might get issues elsewhere.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: What causes an event to become Global
« Reply #2 on: February 13, 2023, 08:47:19 PM »
Are global events bad for performance? And should I instead rather use local globals?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: What causes an event to become Global
« Reply #3 on: February 14, 2023, 01:19:48 AM »
Hi.
I don't think so.
What you should avoid is to use 'Broadcast' on the send event actions.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 256
Re: What causes an event to become Global
« Reply #4 on: February 14, 2023, 06:39:47 PM »
Yeah, I got rid of all "broadcast all" events in my projects.

But I suddenly asked myself, should I rather use normal events without making them global or should I rather actually use global events...

Trying to figure out what the advantages/disadvantages are for each...

for example if I export some setup as an unity asset... would being global make it impossible to import into another project? I think global events are in the same global file as the global variables and it might make it prone to get corrupted?

On the other side, finding global events in the project is easier and therefore I can understand it faster what's happening, while sending event with name is a chaos.

Maybe sending by name is also slower?

Any other points I'm missing?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: What causes an event to become Global
« Reply #5 on: February 15, 2023, 03:24:44 AM »
Hi.
I don't think that sending by name is any slower as the globals are still strings