Hi guys,
i create a Actor class in cpp, and these components:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SkillProjectile")
class UParticleSystemComponent* particle;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SkillProjectile")
class USphereComponent* sphere;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SkillProjectile")
class UProjectileMovementComponent* movement;
then initialized like this:
// Sets default values
ASkillProjectile::ASkillProjectile(const class FObjectInitializer& PCIP)
{
// 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;
RootComponent = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("scene"));
particle = PCIP.CreateDefaultSubobject<UParticleSystemComponent>(this, TEXT("particle")); particle->AttachTo(RootComponent);
sphere = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("sphere")); sphere->AttachTo(RootComponent);
movement = PCIP.CreateDefaultSubobject<UProjectileMovementComponent>(this, TEXT("movement"));
}
,At last i create a blueprint class inherit from it, all things are good but ParticleSystemComponent cannot edit. select it the detail panel like select at root node.
Cheers