Download

Help! SceneComponent in an array can't be edit in editor!(possibly a bug)

This is my .h header:



// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/Actor.h"
#include "MyActor.generated.h"

UCLASS()
class MYPROJECT_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;


	UPROPERTY(EditAnywhere, Category = "Assets")
		USceneComponent  	*ActorsOnEachNote[2] ;
	 
	
};

	

And I try to create new instance, like below:



// Fill out your copyright notice in the Description page of Project Settings.

#include "MyProject.h"
#include "MyActor.h"


// Sets default values
AMyActor::AMyActor()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	ActorsOnEachNote[0] = CreateDefaultSubobject<USceneComponent>(TEXT("Test blah 0"));
	ActorsOnEachNote[1] = CreateDefaultSubobject<USceneComponent>(TEXT("Test blah 1"));
	
}

// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AMyActor::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );

}




Then something odd happened, both ActorsOnEachNote[0] and ActorsOnEachNote[1] created successfully, but
ActorsOnEachNote[0] changed name into ActorsOnEachNote rather than “Test blah 0” I set above, but I can live with that.

**The deadly problem to me is that the ActorsOnEachNote[1] can not be edited in editor! **
What did I miss?
Or Unreal Engine doesn’t support setting UPROPERTY to EditAnywhere for an array?
If it doesn’t, then what should I do to make ActorsOnEachNote[1] editable in editor?

-----------------------------[ActorsOnEachNote[0]]-----------------------------
1e78882fbdb940d736949216109b375c64751059.png

-----------------------------[ActorsOnEachNote[1]]-----------------------------
4340ec62e1daf663ff0a4436f915f2db4df5ad66.png

Try using a TArray https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Containers/TArray/index.html.

I’ve tried TArray, but with no luck,still same issue. :’(
I use CreateDefaultSubobject to create and add it to array.



	UPROPERTY(EditAnywhere, Category = "Assets")
		TArray<USceneComponent*> ActorsOnEachNote;


Edit:I tried on 4.9 and 4.10.