I really couldn’t come up with a good title so please bear with me as ill try to explain what my problem is.I am creating a standard FPS game and (just like many other FPS games) when there’s a weapon on the ground i want the player to be able to grab it and drop the one he is holding.Before i explain the way i did it (because its not working) I want suggestions on how you would make it.Basically im tracking if that gameObject is withing the screen and if the player presses “E” he picks it up.How can i track multiple gameObjects for example a room filled with AK_47 (i am now only taking the tag of the gameObject so can only target one of them at a time as i am checking if that one is within the screen limit).Its been a lond day and im very tired so I apologise in advance if all i just typed makes no sense
i really need some help.In brief, whats the best way to track which weapon im next to or at least how to track multiple of that one weapon.
You could try using a collider on each weapon and when the collision happens register that weapon as valid to pick up. If you need to pick it up anywhere on screen you can cast a ray out to the colliders instead of using the collision with a character controller.