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"

Why BlueprintNativeEvent is not being called on BP?

So I'm trying to make a BlueprintNativeEvent function in C++ and call it through code to execute it in BP. The function:

 UFUNCTION(BlueprintNativeEvent)
 void AddContainer(int32 indexOfContainerInInventory);

it in a class that extends UUserWidget, called UMainInvWidget.

I know it is being called from code because I made the AddContainer_Implementation print a message to the screen when called, and it prints the message. I also know that the BP is not null when I call the function because 1)UE4 doesn't crash and 2) I can see the widget in PIE. And the BP is a child of UMainInvWidget.

So here's the print from the BP:

alt text

Thanks in advance!

Product Version: UE 4.13
Tags:
print.png (48.1 kB)
more ▼

asked Oct 29 '16 at 10:55 PM in C++ Programming

avatar image

ItsaMeTuni
239 19 14 20

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

1 answer: sort voted first

In the c++ code, did you call AddContainer_Implementation() or AddContainer(), because for me it worked when I called the function without the implementation. Also, try adding a const to the end of the declaration so it is AddContainer() const and Add_Implementation() const. This will make it a normal function instead of an event, and it may make it work.

For reference, here is the link I am using: link text

more ▼

answered Feb 13 '19 at 02:37 AM

avatar image

yomaster567
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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