Setupattachment method doesnt update when compiled

Hello Everyone,

I seem to have encountered a bug whilst working with the UE 4.22.3 version. In the full blueprint editor I wanted to assign a parent socket to my camera, so it would follow the head of the skeletal mesh of my character. This however did not seem to be possible because of the message displaying: “Cannot change the parent socket on inherited components”. I noticed this was because my camera is instantiated in C++. This made me have to use the SetupAttachment method which I did. The problem with this is that the parent socket I can pass in by name only updates when I restart visual studio and the engine itself. It does not update when I save and compile the code, I’ve also tried recompiling the blueprint itself, without result.

Steps to reproduce:

  1. Get a skeletalmesh with animations.

  2. Create a C++ script and create a blueprint out of this.

  3. Create a camera with the following code inside of the script inside of the constructor of the class.

    FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FPSCamera"));
    FollowCamera->SetupAttachment(GetMesh(), "head");
    FollowCamera->bUsePawnControlRotation = true;
    
  4. Check in the engine to see if it did manage to set the camera up in the correct way. If not restart the engine.

In case this still is a personal problem, can you help me with it? I can’t seem to find any info on it online.

Cheers.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks