My question is about pick up item like RPG game
In Scene a player found some item and wants to pick up,
A hud shows “Press ‘Action Key’ for pick up” and pressing Action Key this item is added in his inventory.
But this is only possible if the player is looking at the item
I found this event “ReceiveActorBeginOverlap” for physics objects, but only works if Character overlap colliders
I found another solution with Raycast in Tick Function
UWorld* World = GetWorld();
if(World->LineTraceSingle(rayHitResult, WorldFVectorStartPosition, WorldFVectorStartEndPosition, ECC_WorldStatic, TraceParams))
ActorItemWaiting = *rayHitResult->Actor;
and in BindAction function for Action Key
if(ActorItemWaiting != NULL)
is this a best solution?