When making a component with variables like the one below the editor widget is only visible in the “main” viewport, not the blueprint editor viewport (so it can not be manipulated by dragging any more).
Could you elaborate on what exactly is happening? What class does the code you posted belong to? Exactly what behavior are you seeing? Can you post screenshots to show the difference in behavior between the main viewport and blueprint viewport?
Yeah sorry, I was a bit stressed when writing this post. Here is the header of a example class:
#pragma once
#include "Components/SceneComponent.h"
#include "MySceneComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class TEST_4_8_API UMySceneComponent : public USceneComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UMySceneComponent();
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ElevatorProperties", Meta = (MakeEditWidget = true))
FVector EndPoint = FVector::ZeroVector;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ElevatorProperties", Meta = (MakeEditWidget = true))
FVector StartPoint = FVector::ZeroVector;
};
When added to a empty actor in the “world” viewport it works as expected, the widgets are shown and can be dragged. When adding the component to a blueprint class in the blueprint editor viewport the vectors are only editable through changing in the details tab and the widgets are not visible in the viewport.
This is what it looks like when the component is added to an instanced actor in the world viewport:
This is actually the expected behavior. If you look at MakeEditWidget in ObjectBasse.h (also defined here) it says that the property is exposed in the viewport as a movable widget. In this case the viewport being referred to is the main viewport rather than the viewport of a blueprint that has had this component added to it.
Thanks, now I know at least why it does not work. But the follow up question is then why? I only see benefits of keeping the same functionality between the two viewports.
Thank you for your reply! I suspect things will change a bit over time as well with the future “Bluefabs” which is on the roadmap for the coming months. Will try to work around kinks like this meanwhile
Hi ,
I was just wondering if there was any new info on this. I’m trying to make a new feature for our game, and this would be super useful. Just curious if this is being worked on or if there’s any information that might help us implement it ourselves.
This report is still open in our system without an expected fix timeframe yet. If you are trying to do this in your project, it is possible to create the FVector with the MakeEditWidget specifier, the only issue is that the position of those FVectors can only be changed in the level editor rather than in the blueprint itself.