Why do functions don't have visibility?

I am curious to understand why functions don’t have a visibility related attribute.

I’m not 100% sure about how all people use their functions but for me giving functions a visibility option wouldn’t make much sense. I do not really see why you would need it…

Maybe instead of asking us why there is no visibility attribute, try to explain why do you think you need one. You might open a whole new world for us with that question, or we can think of a solution for you problem :slight_smile:

I second that. How does it make sense to have a function visible ? Can you give us an example maybe ?

I am quite new to unreal, but the only way I have seen to cause something to happen in another class are event dispatchers, and eventing and having copies unsincronized of objects around the different object it feels for me as a coding smell, and probably is because i am not used to the paradigms that unreal exposes, so if I miss anything just let me know.

My question comes for example from that I am using a game instance as central point for my game data (being this the object shared across levels it made sense for me). But if I want to update the achievements or the leaderboard from the last data generated from the character I have to create an event dispatcher, bind it, and call the event on my player blueprint (casting the game instance).

This is where my doubt comes from, because either I am missing some kind of paradigm of UE, or for me it will be simpler to have the ability to call public function of my already casted objects with the imput I want (as any oo language).

The extra steps of the dispatcher are causing an indirection that sometimes makes not sure if your object stills exist or is a new one ( this happend to me when I tried to do what I am doing now in the game instance on my main menu HUD).

Dispatcher for me should be use when you want multiple things to know that an event that happened on your game.

Ok I think I can answer my own question now after spending on it some time during the weekend. It is possible to drag and drop from one BP to other the function. This means all functions are actually public.

I’m also getting the idea that you want the ‘visibility’ function to do something else. When you set a Widget to ‘set visible’ it is shown on the screen. Showing a function on the screen would be madness.

I’m getting the idea, correct me if I’m wrong, that you want to set a function to public/private.

The thing is as I answered (on the next post)…the output is that all functions are actually public you can drag and drop them outside their own blueprint.

A function dosnt show on screen i am talking about the design time, no execution time ;). For me functions are ways of encapsulating logic. and make your blueprint more readable also.