Skip to content
Snippets Groups Projects
Commit 9be526b3 authored by Qurabi's avatar Qurabi
Browse files

01-Versuch.

Ausgeben vor und Nach den Änderungen in die Konsole.
Abstand zwischen Start vom Line Trace und ImpactPoint in der IF-Anweisung geprüft.
Radius und HalfHeight vom Collider.
parent da97fa7f
No related branches found
No related tags found
No related merge requests found
......@@ -360,7 +360,6 @@ void AVirtualRealityPawn::PhysWolkingMode()
Direction.Z = 0;
FHitResult FHitResultPhys;
CapsuleColliderComponent->AddWorldOffset(Direction, true, &FHitResultPhys);
CreateLineTrace(Direction, CapsuleColliderComponent->GetComponentLocation(), true);
if (FHitResultPhys.bBlockingHit) {
RootComponent->AddLocalOffset(-FHitResultPhys.Normal*FHitResultPhys.PenetrationDepth, true);
}
......@@ -411,7 +410,7 @@ void AVirtualRealityPawn::VRClimbStepUp(float DeltaSeconds)
//Stepping down or Falling.
else if (!LineTraceUnderCollider.bBlockingHit || (LineTraceUnderCollider.Distance > MaxStepHeight && IsColliderOnGround()))
{
GravitySpeed -= 8000.0f*DeltaSeconds;
GravitySpeed -= 1000.0f*DeltaSeconds;
if (GravitySpeed*DeltaSeconds > -DistancUnderColliderAndGround || !LineTraceUnderCollider.bBlockingHit)
{
RootComponent->AddLocalOffset(FVector(0.f, 0.f, GravitySpeed*DeltaSeconds), true);
......
......@@ -126,7 +126,7 @@ protected:
private:
float DeltaTime = 0.0f;
float GravitySpeed = 0.0f;
UPROPERTY() float UpSteppingSpeed = 8000.0f;
UPROPERTY() float UpSteppingSpeed = 100.0f;
FVector LastCameraPosition;
FHitResult CreateLineTrace(FVector Direction, const FVector Start, bool Visibility);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment