Position/Rotation not available in Actor viewport

For some reason I’m not able to change the position/rotation of my actor component (made in C++) in the actor viewport. It’s not available in details panel, but scale is (see image below). Even if I try to drag it around in the viewport, it will not allow me.

image

image

It only happens after I compile the code. I can delete the actor component from the components list and re-add it, then I have my position and rotation back. But, compile again (without changing any code) and it removes the position/rotation again.

Is this a known bug? Is there a work-around?

EDIT: It appears to bring back the Position/Rotation when you restart the UE5 editor as well.

Can you show the C++ declaration of your actor component:

UCLASS(???)
class UMyActorComponent : ??? {
  
}

(In particular are you deriving from UActorComponent, USceneComponent or UPrimitiveComponent?)

Also have you tried with a different actor component? Like another StaticMesh or whatever, and see if you observe same behaviour just to confirm it is something wrong with your actor component.

UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class SIMTOOLS_API UMyTestComponent : public UWidgetComponent

I tried to test your suggestion, but suddenly it’s not an issue anymore. Whether it’s under StaticMesh or DefaultSceneRoot. Previously, when I would compile, the viewport would refresh. Now it’s not doing a refresh. I’m not sure what I have done different. I’ve only added code to the CPP for managing widgets.

I’ve run into this issue before when playing around with a USkeletonComponent in C++.


UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class SIMTOOLS_API UMyTestComponent : public UWidgetComponent
{
	GENERATED_BODY()
		
public:	

	UMyTestComponent();

	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

protected:

	void BeginPlay() override;
	void OnRegister() override;

	// Blueprint Properties
public:
	
	// The class of User Widget to create and display an instance of
	UPROPERTY(EditAnywhere)
	TSubclassOf<UUserWidget> TargetWidgetClass;
	
	// The desired screen size (in centimers) in 3D space
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FVector2D DesiredSize = { 16.0f, 16.0f };
	
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool MaintainAspectRatio = true;

private:

	void initDisplay();
};

Sorry, are you saying that the problem has gone away? Or do you still have a problem?

It seems to have resolved itself for the time being. I can’t make it happen again.

I have exactly the same issue with my custom USceneComponent. After I recompile the code, the Location and Rotation properties in details panel disappear. If I delete the component from the actor’s hierarchy and add it back again – these properties are visible and I can move my component… what is it?