Hey,
So I have an actor, my ship, which adds engines (Other actors) to itself inside PostInitializeComponents();
i.e
#define ADDENGINE(type, obj, loccomp, bp) \
if (bp) { obj = SpawnBP<type>(GetWorld(), bp, loccomp->GetComponentLocation(), loccomp->GetComponentRotation()); \
obj->ExternalHull = this->ExternalHull; \
HideActorFromExternal(obj); \
obj->SetActorLocation(loccomp->GetComponentLocation()); \
Components.Add(obj); }
void AShip::PostInitializeComponents(){
ADDENGINE(AShipEngine, TestEngine, SmallEngineLocation, SmallEngine);
Super::PostInitializeComponents();
}
- AShipEngine = Type
- TestEngine = instance of AShipEngine*
- SmallEngineLocation = A dummy
USceneComponent that im manipulating
inside my ship blueprint (editor) - SmallEngine =
TSubClassOf , blueprint
reference for the engine that im
setting inside the editor.
this creates the following:
The engine blueprint, (The one in the middle with the button on it) has spawned correct, and is visible inside the ship blueprint( great! ).
Except it is not spawning on SmallEngineLocation’s position like i believe it should be, even when the game is running.
Would appreciate any help - Thanks
PS:
Behaviour works as expected when i manipulate the position of the engine inside the engine blueprint itself.