y5b4a1
(y5b4a1)
September 10, 2022, 9:30pm
1
Hi All,
I’m trying to use SpawnActor like this test…
FRotator br = FRotator::ZeroRotator;
FActorSpawnParameters SpawnInfo;
SpawnInfo.SpawnCollisionHandlingOverride =
ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
ARayActor * _beam = GetWorld()->SpawnActor(FVector{ 0,0,305 }, br, SpawnInfo);
The ARayActors show up on the World Outliner but never never in the camera!!! The BP shows up fine when dragged to the camera.
I’ve looked everywhere for a solution to this and NOONE has a final answer.
Y5B4A1
KaidoomDev
(KaidoomDev)
September 11, 2022, 3:32am
2
You’re not indicating a class here, you might be spawning the native class where you meant to spawn your BP derived class ?
y5b4a1
(y5b4a1)
September 11, 2022, 6:37am
3
Hi!
Sorry, I used…
ARayActor * _beam = GetWorld()->SpawnActor[ARayActor]
(ARayActor::StaticClass(), fv, br, SpawnInfo);
I have another Spawn that is a WayPoint actor - and it works, placing the BoxComponent where I say - and it, a Character, enters it and it functions…you just can’t see the box.
Further, in ARayActor we have in the constructor…
Root = CreateDefaultSubobject[USceneComponent](TEXT(“Root Component”));
Root->DetailMode = DM_Low;
SetRootComponent(Root);
Ray = CreateDefaultSubobjectUStaticMeshComponent ;
Ray->DetailMode = DM_Low;
Ray->SetupAttachment(GetRootComponent());
Ray->SetVisibility(true);
And still the Ray, which is a CONE, in the ActorBP, refuses to show up.
Brand new install of 4.2.7.
Thanks! Y5B4A1