Return an object to a specific location - BP Instance variable & tracing

You seem to be a bit lost in how all that should work, in cases like that i split my big problem into smaller ones, and keep spiting them until i either know how to solve tiny ytask, or know where to look/ask for solution.

In thins case you have two simple tasks mixed together solve one then solve another, and combine them:

  1. first task is remembering original location for actor at being play and returning there upon some event called.
  • so at begin play store either whole TRANSFORM or just actor world location in variable.
  • create event that moves actor back to stored location
  1. second is some logic when item should return and when not when that returning event is triggered
    instead of tracing sphere and all that stuff. You can do some code inside pickup actor that calculates its distance to origin (where it spawned), then you can line trace from camera to that origin and compare traced line length with distance, or check if line trace hit anything.

And last, write here exect conditions for returning dropping it etc. Do not describe it, but write recipe and list of possible states (actions) and when they can happen.

ps. for states or actions, create enumerator and use them easier to read code this way, when you return to that part in few months or years.