Bug UE4.7: Translation of Actor in World Editor

Branch: ‘Binary’ build from the Unreal Launcher
Build version: 4.7 (Final)

I think i have found a bug, or anyway, an unhandled situation.
I have created a PickableObject class in my code, derivate from an Actor, the class works fine and is basically empty right now.
All it does is declare a StaticMeshComponent in it’s Constructor, that code is fine as i’m using it in other classes and works.

This is the public declaration of the StaticMesh:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Mesh, meta = (AllowPrivateAccess = “true”))
class UStaticMeshComponent* ObjectStaticMesh;
i’ve also tried to make it private and leave just this:
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
it doesn’t seem to change the result.
It happens Every time.

Repro Steps:
Drag and Drop PickableObject (Actor derivate) Class into the World in the Editor.
Select the Inherited StaticMesh from Details in the Editor.
Translate it with either X, Y or Z arrows.
Crash (Engine Closes).

The strange thing is that it doesn’t happen when you change the object location manually by writing a different number in the object X, Y or Z position in the editor details. That means the location is free to be changed, but there is a bug somewhere in the Translation (ApplyDeltaToComponent) code, i guess.

My code could even be wrong, but this is a bug in any case, because it shouldn’t crash.

Screenshots:

System Specs: Win8.1 x64, Intel i7 2600K, 8GB Corsair, Nvidia 670GTX 3GB.

There is no relevant Log, i checked all of them, it crashed while in Visual Studio Debugging Anyway.

I’ll past the relevant .cpp and .h
PickableObject.h

#pragma once
#include "GameFramework/Actor.h"
#include "PickableObject.generated.h"

UCLASS(config = Game)
class DREAMUE4PROJECT_API APickableObject : public AActor
{
	GENERATED_BODY()

public:	
	// Sets default values for this actor's properties
	APickableObject(const FObjectInitializer& ObjectInitializer);

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick(float DeltaSeconds) override;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Mesh, meta = (AllowPrivateAccess = "true"))
	class UStaticMeshComponent* ObjectStaticMesh;
};

PickableObject.cpp

#include "DreamUE4Project.h"
#include "PickableObject.h"

// Sets default values
APickableObject::APickableObject(const FObjectInitializer& ObjectInitializer)
{
 	// 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;

	ObjectStaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("HandLeft"));
	FString mpath = "/Game/Models/Character/HandLeft";
	static ConstructorHelpers::FObjectFinder<UStaticMesh> PickupMesh(*mpath);
	ObjectStaticMesh->SetStaticMesh(PickupMesh.Object);
	ObjectStaticMesh->RelativeLocation = FVector(-550.f, 650.f, 0.f);
}

// Called when the game starts or when spawned
void APickableObject::BeginPlay()
{
	Super::BeginPlay();
}

// Called every frame
void APickableObject::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );
}

I have fixed the problem for my project by writing:
RootComponent = ObjectStaticMesh;
in the .cpp constructor, but the bug remains in the engine.
I couldn’t even drag and drop a BluePrint based on that class, it crashed in a similar way.

Hey -

I was able to reproduce the crash you mentioned and have submitted a report to our internal tracking database (UE-11415) for further investigation by an engineer. Thanks for the report and I’m glad you were able to work around it.

Cheers