x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Interfaced BlueprintNativeEvent's not appearing in Blueprint when all params are UPARAM(ref)

I think I've found a bug when using a UInterface with a BlueprintNativeEvent that is trying to pass in non-const refs.

I need the refs to be editable by the blueprint, which means I need to declare the params with UPARAM(ref) to prevent them from being output values only.

Inside my UInterface I declared the following:

 UFUNCTION(BlueprintNativeEvent, Category = "Bonus")
 void ApplyBonus(UPARAM(ref) float& AdditiveBonus, UPARAM(ref) float& MultiplicativeBonus);

Then in my class I provide the ApplyBonus_Implementation(...).

However after adding the UPARAM(ref)'s to function, it no longer appears for implementation in any of the blueprinted objects.

Now the weird part of this is, the event only disappears if ALL of the params are defined as UPARAM(ref)'s. If one param is not a UPARAM, the function shows up in the BP for implementation. I then tested the following cases (result is in the category meta)

 UFUNCTION(BlueprintNativeEvent, Category = "Does Not Show In BP")
 void SingleUPARAMBNE(UPARAM(ref) float& ParamA);
 
 UFUNCTION(BlueprintNativeEvent, Category = "Does Not Show In BP")
 void DoubleUPARAMBNE(UPARAM(ref) float& ParamA, UPARAM(ref) float& ParamB);
 
 UFUNCTION(BlueprintNativeEvent, Category = "Works As Intended")
 void DoubleMixedUPARAMBNE(UPARAM(ref) float& ParamA, float& ParamB);
 
 UFUNCTION(BlueprintNativeEvent, Category = "Works As Intended")
 void DoubleMixedUPARAMBNE2(float& ParamA, UPARAM(ref) float& ParamB);
 
 UFUNCTION(BlueprintNativeEvent, Category = "Does Not Show In BP")
 void TripleUPARAMBNE(UPARAM(ref) float& ParamA, UPARAM(ref) float& ParamB, UPARAM(ref) float& ParamC);
 
 UFUNCTION(BlueprintNativeEvent, Category = "Works As Intended")
 void TripleMixedUPARAMBNE(UPARAM(ref) float& ParamA, float& ParamB, UPARAM(ref) float& ParamC);

I've also tested with non-interfaced versions of the above, which all work as intended. So it seems to be related to interfaces in particular.

Regarding my intended usage; I'd prefer to not to create an event that is MyFunc(float in, float& out), so if there are any other ways to handle this, I'm open to suggestions.

Product Version: UE 4.18
Tags:
more ▼

asked Apr 06 '18 at 09:21 AM in C++ Programming

avatar image

DC
3 3 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question