Hi!
I’m trying to spawn e.g. a directional light:
ADirectionalLight* DirectionalLight = (ADirectionalLight*)GetWorld()->SpawnActor(ADirectionalLight::StaticClass(), &FVector::ZeroVector, &FRotator::ZeroRotator);
The spawned actor already has a pitch value of -46 degrees, even though I spawned it with a zero rotator (not attaching it to any other actor). If I actually specify a rotator for SpawnActor(), t gives me even weirder values. Like, using
FRotator DirectionalLightSpawnRotation(100.f, 5.f, -30.f);
results in a rotation of (8, 82, 41) in the game. Also: the light has a scale of (2.5, 2.5, 2.5) when spawning, but I didn’t even specify a scale in SpawnActor().
I’m having these problems with ALL my actors, but some at least have the proper (1, 1, 1) scale. This even happens when I use the Spawn Actor From Class node in a blueprint, spawning a totally different class! Only when I drag&drop an actor into the level and specify the transform values manually, they are kept that way in PIE. So, is this a bug somehow nobody ever has stumbled upon, or what am I doing wrong / don’t understand here?
BTW, why is the order Pitch->Yaw->Roll in the C++ constructor, but Roll->Pitch->Yaw in the details panel? Always confuses me.
Thanks!