Announcement

Collapse
No announcement yet.

static functions callable from both c++ and blueprints

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    static functions callable from both c++ and blueprints

    Hi,

    I have 2 c++ classes : A and B

    I have 2 blueprints A_BP who inherits from A, and B_BP who inherits from B

    I'd like to create a c++ class "MyMaths" whose every functions are statics and can be used in both my c++ classes and my blueprints

    How to do so please ?

    #2
    Blueprints can use static Ufunctions
    Code:
    public :
    
    UFUNCTION (BlueprintCallable)
    static MyFunc(...);
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      thanks Bruno, and when creating my new class "MyMaths", which class should be its parent ? I have to define a parent class, should i chose "None" ?

      Comment


        #4
        You can use "Blueprint Function Library" class for that. Any subclass of "UObject" can do it, but since Epic added a FunctionLibrary class for that, why not use it..
        | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          #5
          Thank you so much

          Comment

          Working...
          X