I haven’t been using Unity for so long and I’m not that good at coding, yet.
Anyway, i need help with a code for a game I’m making! I want the player to pickup a box hand hold it in front of the camera when pressing the Mouse 1 Key. (It’s a FPS) Then when you press the Mouse 2 Key it will drop/place the object in front of the player.
I would take it one step at a time. A reasonable first step might be to detect when the player has pressed the mouse button while the object is ‘in focus’, so to speak. What ‘in focus’ means is up to you; it could mean that a cursor or reticle of some sort is over the object, or simply that it’s in front of and fairly close to the player. You can confirm that you’re doing this part correctly be (e.g.) making the object disappear when the player presses the mouse button. Once you’ve got that working, you can move on to the next part.
I’m going to try making a reticle and make the box disappear when pressing the mouse button!
I think I’m going to go pick up the “Unity Game Development Essentials” so i can get into coding better.