There is a bug when declaring and creating a component in a custom ACharacter that make this new component’s properties show bugged in the blueprint editor.
Reproducing the bug
- Create a new c++ Character class “Boo”.
- Create a new blueprint BP_Boo inheriting from Boo.
- Declare a component pointer in Boo.h (I used USphereComponent* but it seems to bug with any component) with a UPROPERTY(VisibleAnywhere) macro…
- Initialize the component in Boo’s constructor (I did it calling CreateDefaultSubobject(FName)).
- Compile the class, open the blueprint editor and see the component’s Transform only showing the Scale property.
- Attach the component to the RootComponent (did it calling USceneComponent::SetupAttachment) right after the call to CreateDefaultSubobject.
- Compile the class and check the component’s Transform again. Still bugged.
- Close the engine editor and open again. Check the component’s Transform seem to be showing the correct properties now.
Sometimes however even closing the editor and opening again will not “fix” the problem, then you need to do it again.
I have no idea why this happens as I just started to learn how to use the engine but it’s kinda scary to see such a bug in such a commom work area that isn’t fixed yet.