Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ABasePawn::Tick(float DeltaTime)
- {
- Super::Tick(DeltaTime);
- // v1.0
- if (DeltaTime < 0.125f)
- {
- DrawDebugLine(GetWorld(), SkeletalMesh->GetComponentLocation(), SkeletalMesh->GetComponentLocation() // redundant
- + FVector(0,0,50), FColor::Red, false, 1.0f, 1, 2.0f); // redundant
- SkeletalMesh->GetRelativeLocation() = SkeletalMesh->GetRelativeLocation() * (1.f - DeltaTime / 0.125f);
- DrawDebugLine(GetWorld(), SkeletalMesh->GetComponentLocation(), SkeletalMesh->GetComponentLocation() // redundant
- + FVector(0,0,50), FColor::Blue, false, 1.0f, 1, 2.0f); // redundant
- GEngine->AddOnScreenDebugMessage(-1, -1.f, FColor::Blue, FString(TEXT("Smoothing: Decaying mesh to root.")));
- }
- else
- {
- SkeletalMesh->GetRelativeLocation() = FVector::ZeroVector;
- GEngine->AddOnScreenDebugMessage(-1, -1.f, FColor::Red, FString(TEXT("Smoothing: Teleported mesh to root.")));
- }
- FVector NewRelTranslation = UKismetMathLibrary::InverseTransformDirection(Capsule->GetComponentTransform(), SkeletalMesh->GetRelativeLocation());
- SkeletalMesh->SetRelativeLocation(NewRelTranslation);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement