Added the forwar constant movement
This commit is contained in:
parent
4e5c92477a
commit
4a87eafbb6
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:01a2ccb4fae05146826f110d944ac346e311548b5e59e5e8fe7477b6752d0862
|
oid sha256:6707e0a03a08e3a1aa73dcdfd39c8839e283b0ca3e3e0119415a35d8dcb359dc
|
||||||
size 33555
|
size 34084
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9c79ba59dcd7112872785537bbae4dbf5908ee970011a5191b4524203ebb1fbc
|
oid sha256:ee57909b9de0cae948caddc473536e0d62853e27ce154066e164b74edba3f39e
|
||||||
size 354051
|
size 332032
|
||||||
|
|||||||
@ -68,6 +68,7 @@ void AZombieCharacter::BeginPlay()
|
|||||||
void AZombieCharacter::Tick(float DeltaTime)
|
void AZombieCharacter::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
MoveForwardConstant(DeltaTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,3 +117,11 @@ void AZombieCharacter::Crouch(const FInputActionValue& Value)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AZombieCharacter::MoveForwardConstant(float DeltaTime)
|
||||||
|
{
|
||||||
|
FVector vLocation = GetActorLocation();
|
||||||
|
vLocation += GetActorForwardVector() * fBaseSpeed * DeltaTime;
|
||||||
|
SetActorLocation(vLocation);
|
||||||
|
|
||||||
|
}
|
||||||
@ -63,4 +63,8 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, Category = "Movement")
|
UPROPERTY(EditAnywhere, Category = "Movement")
|
||||||
float fBaseSpeed = 100.f;
|
float fBaseSpeed = 100.f;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void MoveForwardConstant(float DeltaTime);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user