How to attact specific object to one point? C#

Hi, everyone. I am reletively new to Unity as well as scripting. (I just started learning) Currently, I am trying to make a simple game that the character can attract certain object, and when the player lets go of the key, the objects shoots forward.
It’s a lot like Titanfall :D…I think…?
Is there anyway to do this? Please help!!!
@saidthebird

I haven’t played Titanfall, but assuming I understand what you want I would do it like this:

  1. On GetButtonDown shoot raycast from player to the direction player is looking at
  2. If raycast hits object that can be picked up mark it as target
  3. On GetButton keep lerping target infront of player
  4. On GetButtonUp use AddForce to “shoot” the object flying using ForceMode.Impulse or ForceMode.VelocityChange (Impulse is affected by mass, velocity change is not)

If you need help with coding you need to give something that you have tried yourself so we know what to help you with.