Hey! So basically what I am trying to do is make my version of a melee system.
``It is not perfect but I am playing around with the concept because it is simple and easy to understand. Basically, I have a sphere that acts as the collider. The sphere is there to act as a way to tell if the enemy is within reach of the player. You could also use raycasting, but I feel that this way is more simple.
Basically, on the sphere I have a script that detects if the sphere is colliding with the enemy (a cube for now) AND the player has pressed left-click. However, since the script is on the sphere, I need to access the FPSController to detect if the mouse has been clicked. How should I go about doing that? I am new to Unity, and I am mostly playing around with basic concepts, so if you could explain the proper use of GetComponent in this situation I would REALLY appreciate it!
NOTE: I use C#, so if you could explain it to me in C# terms that would be highly appreciated!!!