How do i detect Multiple Things in a Hitbox

Hello Guys!

I’ll make it short dont want to waste anyones time i hope someone can give me an idea :slight_smile:
but im fairly new to UE only worked on it for 3 months so far

so i created a garage door it detects if the player is near it via a hitbox, if so the door opens

this works perfect

the player can enter a car and drive it

however, the garage door won’t open when the player is inside this car
it will open as soon as i exit the car and it will close the moment you enter the car (you’re still standing inside the hitbox)

is there a way to easily integrate the car into this BP?

How is “enter the car” implemented? Do you move the player Pawn to another location or do you de-spawn the character, and possess the car?

Possible solutions could be:

  1. expand the hit box to be bigger, if the problem is that the player pawn is attached to the car seat and thus outside the box
  2. change the cast above, to instead cast to Pawn, and then try to get the Controller from that and cast to PlayerController, and if that works, do the opening bit
  3. implement some interface on your player and car (like GarageOpener) and test for that, instead of your player pawn class
1 Like

thank you for the reply i havent tried the ideas yet

i have a interact interface which i added to the thirdpersoncontroller and the car

this is a BP from the car

i found a solution thanks to your idea

so i basically used my interaction interactor

the gate now opens and closes when:

the player is on foot
the player is in vehicle

the gate doesnt react to an empty car

this is perfect

i share the solution for someone in the future

(im really still learning so my methods might be not the best ones)