Edit a position property on a component in the editors viewport

I’d like to make a platform component with two properties,

        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
	USceneComponent* startPos;

        UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
	USceneComponent* endPos;

The component can then move the actor the component is attached to back and forth between the start and end position.

My question is, is there any way to edit the start position / end position in the editor’s viewport when I place the actor in the level as opposed to typing in the values of start pos/end pos?

Thanks!

#pragma once

#include “CoreMinimal.h”
#include “Components/SceneComponent.h”
#include “MyPlatformComponent.generated.h”

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class YOURPROJECT_API UMyPlatformComponent : public USceneComponent
{
GENERATED_BODY()

public:
UMyPlatformComponent();

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components", meta = (MakeEditWidget = true))
FVector StartPos;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components", meta = (MakeEditWidget = true))
FVector EndPos;

protected:
virtual void BeginPlay() override;

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

};

Hey @elbarrito I gave that a try but I don’t see any widgets in the viewport

EDIT: Actually, it worked the widgets were just at the origin!

Thank you, I marked it as the answer

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.