StaticMeshComponent Added in C++ Only Shows After Clicking Compile in BP Even Tho Compile is Green CheckMark

Dear Friends at Epic,

I am loving UE4, thanks so much for making it!


I hope you dont see what I am writing here as nit-picky, as for lack of understanding of this process I am about to describe I spent about 3 hours debugging the issue.

And so I feel it is my duty as Rocket Beta tester to explain this issue in-depth


Context

I have been adding many many components to my character via the c++, perhaps not the best route but it was working for me so I just kept at it.

I ran into the following issue

  • I would add a new component via the c++ code, code posted below, having retrieved the asset path from within the editor

    //ShoulderL
    static ConstructorHelpers::FObjectFinder StaticMeshOb_ThighPadL(TEXT(“StaticMesh’/Game/thighpad.thighpad’”));
    Asset_RoyalThighPadL = StaticMeshOb_ThighPadL.Object;

     //Was Sword Asset Found?
     if (Asset_RoyalThighPadL != NULL)
     {
     	
     	//create new object
     	RoyalThighPadL = PCIP.CreateDefaultSubobject < UStaticMeshComponent > (this, TEXT("TheRoyalThighPadL"));
     	Components.Add(RoyalThighPadL);
     	
     	//Set to Asset
     	RoyalThighPadL->SetStaticMesh(Asset_RoyalThighPadL);
     
     	//RoyalSword->AttachParent = CapsuleComponent;
     	RoyalThighPadL->bOwnerNoSee = false;
     	RoyalThighPadL->bCastDynamicShadow = false;
     	RoyalThighPadL->CastShadow = false;
     	RoyalThighPadL->BodyInstance.SetMovementChannel(ECC_Dynamic);
     	RoyalThighPadL->BodyInstance.SetCollisionEnabled(ECollisionEnabled::NoCollision);
     	
     	//socket name on character mesh
     	RoyalThighPadL->AttachTo(Mesh, FName(TEXT("ThighPadLeft"))); 
     	
     	RoyalThighPadL->SetHiddenInGame(false);
     	
     } // asset not null
    
  • I would compile my code and go in game, and component would NOT show up

  • I would go into editor and look at my blueprint component page for my character, and the component was listed and


most importantly

the Compile button had the green arrow telling me all was well (not the orange check mark indicating recompile required


After 3 hours puzzling over this

I decided to just click the recompile button anyway, even though it was already green checkmark


to my delight

the situation immediately changed, and the tooltip saying MISSING went away and the name of the component appeared (I did not notice it was missing at first)

annnnd

best of all

then the component would show up in game finally (after 3 hours of puzzling absence)!


Reproducing

To reproduce this you’d have to add a static mesh component , or skeletal, entirely through code and the only compile the C++

then you’d find the component not showing in game, probably, and need to recompile the already green check marked BP

I have reliably reproduced this issue for every component I’ve added via the c++ to my character ever since the first 12 or so.


The Odd Thing

This behavior only started after about 10 components had been set up in the C++ blueprint

So again I know it might sound nitpicky, but it cost me 3 hours and I thought you might like to know about it as a polishing possibility


My Suggestions

  1. Is there some way to auto-recompile the Blueprint when editor is loaded and it is suspected that a new component was added strictly through code

  2. could that little tooltip, which obviously knows something is “MISSING”, could that tooltip’s logic tell the Green Check Mark compile button about it, so that it turns orange question mark to indicate recompile necessary?


My Point

I only avoided clicking the recompile button for 3 hours because it was showing green checkmark

orange question mark would have told me immediately what was going on

Any questions about my scenario or suggestions please let me know :slight_smile:

Rama

Hey Nathan,

I was able to get this in Rocket as well. I’ve let the team know.

Best regards,

Ryan

Thanks Ryan!

:slight_smile:

Rama