Description

A nativized Blueprint cannot currently invoke a non-public BlueprintCallable function that's defined in native C++ code without resulting in a C++ compile error.

Example: APlayerController::PlayDynamicForceFeedback()

Current workaround: Locally modify the native class declaration to move the BlueprintCallable function into a "public" section.

Steps to Reproduce
  1. Create a new (blank) Blueprint-only project.
  2. Add a new Actor-based Blueprint class.
  3. Double-click to open the new Blueprint in the editor.
  4. Switch to the Event Graph tab.
  5. Right-click next to the BeginPlay event and choose "Get Player Controller."
  6. Drag off the GetPlayerController node's return value pin and choose "Play Dynamic Force Feedback"
  7. Connect the "Start" pin to the BeginPlay event's exec pin.
  8. Compile and save the Blueprint class.
  9. Drag a new instance into the Untitled map and save (NewMap).
  10. In Project settings, set the default game map to 'NewMap' and set Blueprint nativization to "Inclusive."
  11. Choose File->Package Project->Windows->Win64 and choose a location, then wait for packaging to complete.
  12. An error will result during the build that follows the cook step:
    UATHelper: Packaging (Windows (64-bit)):     D:/dev/local/Projects/NatPrivateTest/Intermediate/Plugins/NativizedAssets/Windows/Game/Source/NativizedAssets/Private/NewBlueprint__pf1010915279.cpp(477): error C2248: 'APlayerController::PlayDynamicForceFeedback': cannot access private member declared in class 'APlayerController'
    UATHelper: Packaging (Windows (64-bit)):     D:\dev\UE4\Dev-Framework\Engine\Source\Runtime\Engine\Classes\GameFramework/PlayerController.h(1088): note: see declaration of 'APlayerController::PlayDynamicForceFeedback'
    UATHelper: Packaging (Windows (64-bit)):     D:\dev\UE4\Dev-Framework\Engine\Source\Runtime/Engine/Classes/Matinee/MatineeActor.h(13): note: see declaration of 'APlayerController'
    

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-76369 in the post.

8
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.214.224.23
CreatedJun 17, 2019
ResolvedJul 15, 2021
UpdatedJul 19, 2021