Hello, so I was doing the unreal courses and I was trying to do my own thing at the same time, and I have been trying to do this and trying to find a solution but I cannot find anything online, so I’m obviously missing something. I’m sorry because I’m sure this is a stupid question but I’m starting to lose my mind, and I’m sure that with this figured out I will understand a lot of other things.
I’m working from c++, and I’m trying to do this Blueprint for a platform that moves between two points, so what came to my mind was to use an actor with a mesh and two additional scene components to have a “from” position and a “to” position. (I think that Unreal has type of actor for moving platforms, but that is not the point)
The thing is that I though I could just declare a UPROPERTY variable in the header file for the “from” and “to” positions, then assign the SceneComponents in the Details panel in the Blueprint, but I’m not even able to make even the UPROPERTY to show in the Details panel. What I am missing here? How can I get those SceneComponents in my cpp code and use them?
To give a little background, I come from Unity so maybe I’m totally wrong in the way to approach this.
Here is my header file:
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Components/SceneComponent.h"
#include "MovingPlatform.generated.h"
UCLASS()
class UNREAL_PLATFORM_TEST_API AMovingPlatform : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMovingPlatform();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
UPROPERTY(EditAnywhere)
USceneComponent* FromPosition;
};
And here is my blueprint:
Thank you.