How do i make an icon pop up when player is near a door?

W

waturi

Guest
I'd like to have an interact icon pop up when the player object is near a door, and disappear when the player moves away from the door or pushes a specific button to open the door.

I have my obj_player, obj_door, and obj_interact icon. The "E" key is pressed to open the door.

I want the icon to appear on top of the door.

Thanks!
 

obscene

Member
Do something like this in a controller object or maybe even from the player...
(psueocode)

Code:
if notice does not exist
 {
 with player
    {
    if instance_place door
      {
      create notice at door.x, door.y-100
      }
    }
 }
else
 {
 with player
   {
   if  not instance_place door
     {
     destroy notice
     }
   }
 }
 
Top