In c++ create new component that derives from scene component
// (TestSceneComponent.h)
#pragma once
#include "TestSceneComponent.generated.h"
UCLASS(BlueprintType, Blueprintable, meta=(BlueprintSpawnableComponent))
class UTestSceneComponent : public USceneComponent
{
GENERATED_BODY()
public:
/** Foo */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
int32 FooValue = 1234;
};
now in UEditor, derive blueprint class from this component (let’s name it DerivedTestSceneComponent), then create AActor derived blueprint class (let’s name it DerivedComponentTestActor).
Now open DerivedComponentTestActor, and put DerivedTestSceneComponent below the root component (do not replace it, DerivedTestSceneComponent is a child of the root node),
in the blueprint editor viewport let’s change the position/rotation/scale of the DerivedTestSceneComponent to whatever values you like and change FooValue into something (latsy say 1), compile & save.
Now put this blueprint into the scene. In details view observe that the translate/rotate/scale & FooValue is exacly that same as in blueprint (let’s say this is obvious and desired behaviour ).
Now save the level, load it, go in world outliner to our actor and observe the values once again … they are all DEFAULTS (identity transform, FooValue set to 1234) … why ?
So the questions:
It’s a bug ?
It’s by design ? (if the second one - why ?)
PS.
The test project (4.12.2) (first person shooter template with added exacly 1 cpp/h file) can be downloaded from: http://mxadd.org/ue4/TestProject.zip
(just put ‘/Game/FirstPerson/Tests/ActorWithDerived.ActorWithDerived’ into scene, save, load and observe that the object have different values than the blueprint)
One additional note: If I change any property (including transform) from default value to any other (so the yellow arrow is placed next to it in detail view) when editing DerivedTestSceneComponent (then compile & save), then this property is properly serialized/deserialized on the level when DerivedComponentTestActor is put into scene, also editing values on the level (After DerivedComponentTestActor is instantiated) got proper serialization/deserialization behaviour.