How do I get an event on an item that is only emitted when the player is on top and presses confirm?

I am trying to write a simple interaction between the player and an item in Pulp.

It’s almost what collect does, but I only want it to fire when the player is directly above the item and presses the confirm button.

Is there a way to simply achieve this?

Unless I'm misunderstanding what you want to do, i think that

on confirm do
   emit "event"

and for in the item:

on event do
   if event.x==event.px then
      if then

would work.

1 Like

This is exactly it gummipferd. Thank you!

I was considering comparing the player coordinates with the item coordinates just somehow missed that it can be done through px and py.