Hello!
I’m making an FPS and I have the basic controls and everything set up, but I wanted to know something. I’ve used the code:
Screen.lockCursor = true;
So my mouse is now centered and locked in the middle of the screen. I wanted to know how I could get an object that was within a certain distance of the CharacterController (the player) and in the center of the screen where the mouse was? Then, when the object passes all of these and the player presses “E” (or the USE button), then the object does something.
The concept is kind of similiar to that of Source games like Half-Life 2, Garry’s Mod and Team Fortress 2 where you push your “USE” button and something happens, like a door opens up, or whatnot.
Thanks in advance!