New stuff
This commit is contained in:
@@ -201,6 +201,7 @@ FVector AFireworksPawn::ApproximateThrowVelocity(EControllerHand Hand)
|
||||
// Throw object
|
||||
void AFireworksPawn::ThrowObject(APickableObject* Object, EControllerHand Hand)
|
||||
{
|
||||
Object->ThrowingHand = Hand;
|
||||
Object->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
|
||||
Object->StaticMesh->SetSimulatePhysics(true);
|
||||
Object->StaticMesh->SetPhysicsLinearVelocity(ApproximateThrowVelocity(Hand) * ThrowVelocityMultiplier);
|
||||
@@ -274,7 +275,7 @@ void AFireworksPawn::TryUpdateLasers()
|
||||
FVector EndLocation = StartLocation + (WidgetInteractionL->GetForwardVector() * WidgetInteractionL->InteractionDistance);
|
||||
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitL, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
|
||||
LaserL->SetHiddenInGame(false);
|
||||
LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.Distance >= 5.0f ? CurrentLaserHitL.Distance : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z));
|
||||
LaserL->SetRelativeScale3D(FVector((CurrentLaserHitL.bBlockingHit ? CurrentLaserHitL.Distance / 5 : 1000.0f), LaserL->GetRelativeScale3D().Y, LaserL->GetRelativeScale3D().Z));
|
||||
}
|
||||
|
||||
// --- Right Hand ---
|
||||
@@ -284,6 +285,6 @@ void AFireworksPawn::TryUpdateLasers()
|
||||
FVector EndLocation = StartLocation + (WidgetInteractionR->GetForwardVector() * WidgetInteractionR->InteractionDistance);
|
||||
GetWorld()->LineTraceSingleByChannel(CurrentLaserHitR, StartLocation, EndLocation, ECollisionChannel::ECC_Visibility);
|
||||
LaserR->SetHiddenInGame(false);
|
||||
LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.Distance >= 5.0f ? CurrentLaserHitR.Distance : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z));
|
||||
LaserR->SetRelativeScale3D(FVector((CurrentLaserHitR.bBlockingHit ? CurrentLaserHitR.Distance / 5 : 1000.0f), LaserR->GetRelativeScale3D().Y, LaserR->GetRelativeScale3D().Z));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user