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"

Override C++ event in Blueprint

Hi,

I have some C++ events, the code of the event is in c++, but for some specific usage i want the posibility of overiding them in BP.

I have try UFUNCTION(BlueprintImplementableEvent) but doesn't work.

so how can I have C++ code for event and add some specific code in BP depends of my usage, the C++ code for the evant will be always used

Product Version: UE 4.8
Tags:
more ▼

asked Aug 21 '15 at 04:49 PM in C++ Programming

avatar image

Talus
179 34 35 43

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

2 answers: sort voted first

have you tried adding "_Implementation" to the function name in the .CPP?:

.h

  UFUNCTION(BlueprintNativeEvent)
  void OnBeginFocus();

.cpp

 void AUsableActor::OnBeginFocus_Implementation()
  {
      // Used by custom PostProcess to render outlines
      MeshComp->SetRenderCustomDepth(true);
  }
more ▼

answered Aug 22 '15 at 06:45 AM

avatar image

ScottSpadea
9.6k 320 205 450

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

You want to use BlueprintNativeEvent when you want the native version to be called when there is no Blueprint handler

more ▼

answered Aug 21 '15 at 05:54 PM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image Talus Aug 21 '15 at 07:28 PM

I try but not working (Not compilling)

my .cpp event :

 void AUsableActor::OnBeginFocus()
 {
     // Used by custom PostProcess to render outlines
     MeshComp->SetRenderCustomDepth(true);
 }

my .h event :

     UFUNCTION(BlueprintNativeEvent)
     void OnBeginFocus();


this the default code for the event, I need it everywhere, even when I override the event in blueprint

(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