How to avoid this weird thing that I can't describe

Screenshot 2025-01-06 5.05.17 PM
It’s very simple. In my jam game, Nightclub Skirmish I want it so that you can pick up items off the ground with E. However, when I am near 2 items at the same time they both have the E message meaning that whenever I start coding the ability to pick up items, I might be able to pick up 2 items at the same time causing me to pick up one item and have the other vanish. (you can push around items on the ground.)

How do I avoid this?

  1. You could instead have the player use a small Proximity, make sure to have it set to “Closest”
  2. Then, using the X & Y coords, you can get the angle to the item.
  3. Shoot a Raycast in that direction (make sure it’s set to the item/parent item).
  4. Once it hits, send a Message to “Last raycasted”

When the item receives this message, display the button.

2 Likes

oh shoot that’s such a simple solution

thanks CA!

1 Like