-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMovingPlatform.h
More file actions
45 lines (32 loc) · 1.22 KB
/
Copy pathMovingPlatform.h
File metadata and controls
45 lines (32 loc) · 1.22 KB
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
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MovingPlatform.generated.h"
UCLASS()
class OBSTACLESASSAULT_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;
private:
UPROPERTY(EditAnywhere, Category="Moving ");
FVector PlatformVelocity=FVector(100,0,0);
UPROPERTY(EditAnywhere, Category = "Moving ");
float MovedDistance = 100;
FVector StartLocation;
// for rotation
UPROPERTY(EditAnywhere, Category = "Rotation");
FRotator RotationVelocity;
void MovePlatform(float DeltaTime) ;
void RotatePlatform(float DeltaTime);
bool ShouldPlatformReturn() const;//making function const means you cannot modify any vairable of class inside the function it is forced by the compiler and only those function which are const function only they can be called inside the const function
float GetDistanceMoved() const;
};