Skip to content
Snippets Groups Projects

feature(Interaction): improve grabbing

2 files
+ 6
3
Compare changes
  • Side-by-side
  • Inline

Files

@@ -17,7 +17,6 @@ UGrabComponent::UGrabComponent()
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these
// features off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
@@ -27,8 +26,6 @@ void UGrabComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorC
TArray<UInteractableComponent*> CurrentGrabCompsInRange;
TArray<AActor*> ActorsToIgnore;
ActorsToIgnore.Add(GetOwner());
TArray<FHitResult> OutHits;
const ETraceTypeQuery TraceType = UEngineTypes::ConvertToTraceType(ECollisionChannel::ECC_PhysicsBody);
@@ -90,6 +87,9 @@ void UGrabComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent)
if (!Pawn)
return;
// Probably not the best place to add this.
ActorsToIgnore.AddUnique(GetOwner());
UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(Pawn->InputComponent);
if (EI == nullptr)
return;
Loading