Hello, I am new to Unity and I was wondering how I would go about doing this:
My aim is to detect when a player / character is near to a door so it will prompt the player with something like (‘Press E to open the door’), then the player will be able to open the door whilst they are still in the proximity of the doors detection range otherwise when they press ‘e’ nothing would happen.
Pseudo Code example idea of what I think it might look like:
detection_range = 3
if players distance is <= detection_range
alert the input message(e.g ‘e’)
if input == input message(‘e’)
I know my question is a bit vague but I appreciate any help