Skip to content
Snippets Groups Projects
Commit 34aeeeea authored by Ali Can Demiralp's avatar Ali Can Demiralp
Browse files

Ensuring DisplayClusterPawnCAVE is functional even when a flystick is not available (i.e. editor).

parent 986c727e
No related branches found
No related tags found
No related merge requests found
...@@ -5,13 +5,12 @@ ...@@ -5,13 +5,12 @@
void ADisplayClusterPawnCAVE::BeginPlay() void ADisplayClusterPawnCAVE::BeginPlay()
{ {
Super::BeginPlay();
Flystick = IDisplayCluster::Get().GetGameMgr()->GetNodeById("flystick"); Flystick = IDisplayCluster::Get().GetGameMgr()->GetNodeById("flystick");
} }
void ADisplayClusterPawnCAVE::MoveForward(float value) void ADisplayClusterPawnCAVE::MoveForward(float Value)
{ {
if (!Flystick) if (!Flystick)
Flystick = IDisplayCluster::Get().GetGameMgr()->GetNodeById("flystick"); Flystick = IDisplayCluster::Get().GetGameMgr()->GetNodeById("flystick");
if (!Flystick || value == 0.0f) Flystick ? AddMovementInput(Flystick->GetForwardVector(), Value) : Super::MoveForward(Value);
return;
AddMovementInput(Flystick->GetForwardVector(), value);
} }
...@@ -12,7 +12,7 @@ class NDISPLAYEXTENSIONS_API ADisplayClusterPawnCAVE : public ADisplayClusterPaw ...@@ -12,7 +12,7 @@ class NDISPLAYEXTENSIONS_API ADisplayClusterPawnCAVE : public ADisplayClusterPaw
public: public:
virtual void BeginPlay() override; virtual void BeginPlay() override;
virtual void MoveForward(float value) override; virtual void MoveForward(float Value) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Pawn") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Pawn")
UDisplayClusterSceneComponent* Flystick = nullptr; UDisplayClusterSceneComponent* Flystick = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment