10#include "CoreMinimal.h"
11#include "Components/ActorComponent.h"
12#include "UInteractionSystem.generated.h"
19UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
20class ONEPIECE_API UInteractionSystem :
public UActorComponent
28 virtual
void BeginPlay() override;
29 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType,
30 FActorComponentTickFunction* ThisTickFunction) override;
38 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interaction")
39 float InteractionDistance = 1200.0f;
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Debug")
43 bool bShowDebugInfo = true;
50 UPROPERTY(BlueprintReadOnly, Category = "Interaction")
51 TObjectPtr<class UInteractableComponent> CurrentTarget;
54 UPROPERTY(BlueprintReadOnly, Category = "Interaction")
55 TObjectPtr<class UInteractableComponent> HoldingInteractable;
62 UFUNCTION(BlueprintCallable, Category = "Interaction")
66 UFUNCTION(BlueprintCallable, Category = "Interaction")
70 UFUNCTION(BlueprintCallable, Category = "Interaction")
74 void RegisterInteractable(class UInteractableComponent* Interactable);
77 void UnregisterInteractable(class UInteractableComponent* Interactable);
80 UFUNCTION(BlueprintCallable, Category = "Interaction")
81 USceneComponent* GetHoldPosition() const;
84 UFUNCTION(BlueprintCallable, Category = "Interaction")
85 bool PerformCenterLineTrace(FHitResult& OutHit);
93 UInteractableComponent* DetectInteractableTarget();
102 TArray<TObjectPtr<class UInteractableComponent>> NearbyInteractables;
Main character driven directly by the player.