I’ve noticed strange and quite serious problem.
Almost any actor which I drop on map in editor can lost location and change it to World zero location. It’s totaly random and concerns diferent actors (also c++ and Blueprints). Also this location change is happening not when I use PIE but just in editor (not runtime). This happens sometimes after hot reaload and I can’t notice any dependency realeted with this. I found this problem on 4.13 for the first time.
I’m not sure that I discribed it clear. So for exemple:
- I drop couple diferent actors on map with editor (c++/BP nevermind)
- Make some compiles
- Every actor in level is in correct location
- Make couple next compiles
- Some actors have moved to World zero location
This is constructor from one of my “disappearing” classes. Its realy noting complicated, so I don
t understand… why?
ASwitchController::ASwitchController()
{
// 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;
struct FConstructorStatics
{
ConstructorHelpers::FObjectFinderOptional<UTexture2D>MarkerTextureObject;
FName ID_CatagoryName;
FText NAME_DisplayName;
FConstructorStatics() : MarkerTextureObject(TEXT("Texture2D'/Game/2DSideScroller/Sprites/S_Trigger.S_Trigger'"))
, ID_CatagoryName(TEXT("Marker"))
, NAME_DisplayName(NSLOCTEXT("SpriteCategory", "TokenMarker", "TokenMarker"))
{
}
};
static FConstructorStatics ConstructorStatics;
BillboardComponent = CreateDefaultSubobject<UBillboardComponent>(TEXT("SpriteName"));
SpriteTexture = ConstructorStatics.MarkerTextureObject.Get();
BillboardComponent->Sprite = SpriteTexture;
BillboardComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision);
UCapsuleComponent* CapsuleComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("RootComponent"));
CapsuleComponent->InitCapsuleSize(100, 120);
CapsuleComponent->SetCollisionProfileName(TEXT("OverlapAll"));
SetRootComponent(CapsuleComponent);
BillboardComponent->SetupAttachment(RootComponent);
CapsuleComponent->bGenerateOverlapEvents = true;
CapsuleComponent->SetHiddenInGame(false);
}