-
Notifications
You must be signed in to change notification settings - Fork 0
/
FloatingPlatform.h
52 lines (44 loc) · 1.45 KB
/
FloatingPlatform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "FloatingPlatform.generated.h"
UCLASS()
class FIRSTPROJECT_API AFloatingPlatform : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AFloatingPlatform();
// add mesh property for platform
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Platform")
class UStaticMeshComponent* Mesh;
//start point vector
UPROPERTY(EditAnywhere, Category = "Locations")
FVector StartPoint;
//end point vector
UPROPERTY(EditAnywhere, meta = (MakeEditWidget = "true"), Category = "Locations")
FVector EndPoint;
//movement speed for platform
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Platform")
float InterpSpeed;
//time default
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Platform")
float InterpTime;
//distance
float Distance;
//timer for inter movement
FTimerHandle InterpTimer;
// bool check
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Platform")
bool bInterping;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
void ToggleInterp();
// swap after reach destination to start reverse interp
void SwapVectors(FVector& VOne, FVector& VTwo);
};