When to use Public Variables

I’m personally using public variables all the time since:

  1. Casting is particularly expensive (if you can avoid it in any way, don’t ever cast on tick for instance)’
  2. Exposing variables (making them public) also means they will be listed in the “defaults” tab, so they can be easily edited within the editor.
  3. It’s also (as i understand and also experienced) good practice to “expose on spawn” various variables - especially references - in order to avoid the need of other less efficient/clumsy alternatives like getting all actors of class or - as mentioned earlier - casting.
    These are the main reasons that come to mind quickly, there are other benefits but it really depends on the situation/code.

What I would also advise against is just messing with other BPs variables: setting them (changing their values) from other blueprints. If you need to do that, just make a function/event etc., and have the owning blueprint change it’s own variable(s), which means it doesn’t need to be public.

Anyway, idk why blueprints are “messy as they are” but probably others better equipped at this than me know what they speak of. I’m just telling you what I’ve learned so far about public variables and how I personally use them.

glhf!