Announcement

Collapse
No announcement yet.

I have some confusion about BlueprintNativeEvent and default implementation.

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

    I have some confusion about BlueprintNativeEvent and default implementation.

    I followed the three class creation tutorials (blueprint, code and code+blueprint). In the third tutorial (here) it walks you through setting up a BlueprintNativeEvent.

    The documentation says:
    there is a native default implementation of the function that is called if the Blueprint does not override the function. This is useful for things where you want some sort of default behaviour if the Blueprint does not implement it, but want the Blueprint to be able to override the functionality if desired. These are more costly, so we only put them in where the functionality is needed. When you override the BlueprintNativeEvent, you can still call the native implementation, if desired, by right clicking on the event or function entry node, and selecting "Add call to parent".

    In my case however when I overlap the sphere the blueprint implementation is called (the light changes to a random color) AND the native implementation is called (the light goes out). I only see the light (and it's new random color) when overlap end fires and the native implemention toggles the light on.

    As the docs say its supposed to be optional that the naitive implemenation is called by right clicking on the event in the event graph and selecting "Add call to parent". However that menu item is disabled.

    TLDR; Seems like, in this example at least, the naitive implementation is always being called for a BlueprintNativeEvent even when overridden in a blueprint despite the documentation saying otherwise.

    #2
    I'm not aware of any issues with the BlueprintNativeEvent call chain -- can you give more details on your situation? Are you overriding the MyEvent_Implementation() function or the base MyEvent() function in native code?
    Senior Engine Programmer, UE4, Epic Games
    Twitter:
    @Byooler

    Comment


      #3
      I double checked that I had followed the tutorial correctly and think I found the issue.

      It looks like the text is correct but the corresponding LightSwitchBoth_BP blueprint illustration is wrong in the documentation.
      at https://docs.unrealengine.com/latest...nts/index.html

      The text says:

      The OnOverlap event node is connected to a Set Light Color node. Whenever the event executes, it will cause the light color of the PointLightComponent to be set to a random color. This overrides the OnOverlap_Implementation function in the source file, which toggles the visibility of the PointLightComponent.
      The blueprint illustration shows sphere1's OnComponentBeginOverlap being used event instead of LightSwitchBoth OnOverlap:

      Click image for larger version

Name:	Both_EventGraph.jpg
Views:	1
Size:	53.5 KB
ID:	1050304

      So it should look like this I think:

      Click image for larger version

Name:	Ja175p0.png
Views:	1
Size:	99.5 KB
ID:	1050305
      Last edited by tmek; 04-29-2014, 03:58 PM.

      Comment


        #4
        Yep, I think you are correct, good catch! I'll pass this onto the docs team to get that fixed up. Sorry for the confusion.
        Senior Engine Programmer, UE4, Epic Games
        Twitter:
        @Byooler

        Comment

        Working...
        X