Random actor lost location

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:

  1. I drop couple diferent actors on map with editor (c++/BP nevermind)
  2. Make some compiles
  3. Every actor in level is in correct location
  4. Make couple next compiles
  5. Some actors have moved to World zero location

This is constructor from one of my “disappearing” classes. Its realy noting complicated, so I dont 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);
}

Hey Waw K-

Are you using an instance of the class placed in the level or a blueprint of the class that is being added to the level? I have not been able to reproduce the behavior you mention on my end. If possible, could you provide a sample project with this issue occurring for additional information?

Hey !
Thank you for your interesting. I’ve described my problem more precisely on progrming c++ section. But it is just a proove that I’m not crazy realy.

This problem concerns also c++ instance and blueprints (no difference).
I will try to cut out rest of my project to send you just the problematic sample. I will let you know in a couple days. This happend after migrate from 4.10 to 4.13 btw.

I’ve been working with Unreal since four years and this problem is the realy most strange thing in my programmer carrer :slight_smile: It’s realy interesting why this is happening.

There have been a number of changes and updates to the engine since 4.10. I would try upgrading your project through each engine version (4.11, 4.12, 4.13) separately rather than jumping from 4.10 to 4.13. If the issue still occurs after this please send the sample project when you have the chance.

Hey Waw K-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers