Do that before each function declaration, but construstors and destructors wont work with that.
List of parameters for UFUNCTION():
In your case “BlueprintCallable” is the right parameter already, but there are much more. You also always have to add a category. The String you put in there does not matter. Its only for sorting purposes in the BP-Editor.
I think you have to use the UCLASS() and GENERATED_UCLASS_BODY() macros as well, to make it work:
Thank you so much for your answer. My functions are not appears in Blueprint but i notice from your screen shot that you create your class as an actor. I create an empty c++ class. Now i will try it in you way. I will let you know about the result. Thanks Joe.
Hmm, I think I missunderstood you. You want to call this functions from anywhere in your project? Thats a littlebit more tricky. Or do you want to inherit from that class in blueprint? Then the solution above should work…
Sorry for the delay … i came from lunch:
“Hmm, I think I missunderstood you. You want to call this functions from anywhere in your project? …”
Yes that’s it. Basically i notice that the key press node (A key, B key, …, Z key, Space, etc) work only in Level bluprint: it is not working in my created blueprints. Finally i decide to create a bool variable from level blueprint but i could’t have access on it from my blueprint.
Finally i Google search and i saw that someone post that we can only create static variable form c++.
I may be wrong try it this way but. Let me know if you still missunderstand.
I don’t know if UE4 doesn’t like me but it is not working by fallowing your steps from the link Input in Unreal Engine | Unreal Engine 5.1 Documentation … but i will try it again at home. Maybe there is an error on the UE4 software installation or something. I will try again on a colleague’s machine.