PLAYER SCRIPT
SCRIPT NEEDS TO ACCOMPLISH...
User Input --> Left Mouse Click
Fire Raycast from Mouse position
If collides with object, gather data
If object is a cube, modify color
CODE BREAKDOWN
LINE 10 - 35 ==> If statement that is ran when the user presses the left mouse button
LINE 12 --> Creates a Vector2 type variable to hold the position of the mouse
LINE 13 --> Defines the starting point of the ray [rayOrigin]
LINE 17-34 ==> If statement that returns true when the ray intersects into any collider [Raycast Declaration]
LINE 21-22 --> If statement that tells the program to do nothing if the variable
hitRender
is nullIf tag matches case Cube --> change the color
If tag matches case Sphere --> Do nothing
Last updated