Raycasting for FPS
This is a ready to use demo for simple shooting mechanics for an FPS game in Unity. It follows where the mouse is pointing, and once clicked, shoots out a raycast. This raycast is shot out from wherever the mouse clicked, which allows for point precision in accuracy, and can have varying reactions based off of what you hit.
Custom Key Binding Part 3
Once the event has begun, the script detects the next key pressed and sets the button value to that key. A good example of this is to say that on default, the W key is set to an up function, but through the event, the player can remap the up function to any key on their keyboard they wish. Once the event finishes, there is a save keys function that is achieved through Unity UI. This saves the keys to the player prefs to remember the settings as long as this data is stored locally.