make a raycast point towards the player?

I’m trying to make these chests interactable so that when the player right clicks, the chest will open. i only want this to work when the player is close to it though. should i use a raycast? proximity? if so how would i set it up like that?

Proximity that turns on a switch allowing you to click.

@meburningslime how would i do that with just the x and y outputs?
could you take a screenshot?

@meburningslime wait i did it!
i didn’t know you could do that with proximity.
thank you!

No problem :slight_smile:

@meburningslime I’m having a problem with this. is there a way so that it will know when the player is not close to it? Because if i walk near a chest, walk away, and right click (the interaction button in my game) the chest will still open.

Btw i have no idea what time zone you live in so i don’t know how late it is there. If it’s late or you’re busy I can wait.

@F3Art, Use a NOR gate to turn the switch back off.

Use a nor logic gate that the proximity goes in to. That not gate shuts off the switch.

got it