Hello!
I am writing to ask how you would add a cursor to this script. It isn’t the full script. If you need the full script I will add it.
void FindPlayerInput ()
{
// find vector to move
inputMovement = new Vector3( Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical") );
// find vector to the mouse
tempVector2 = new Vector3(Screen.width * 0.5f,0,Screen.height * 0.5f); // the position of the middle of the screen
tempVector = Input.mousePosition; // find the position of the moue on screen
tempVector.z = tempVector.y; // input mouse position gives us 2D coordinates, I am moving the Y coordinate to the Z coorindate in temp Vector and setting the Y coordinate to 0, so that the Vector will read the input along the X (left and right of screen) and Z (up and down screen) axis, and not the X and Y (in and out of screen) axis
tempVector.y = 0;
inputRotation = tempVector - tempVector2; // the direction we want face/aim/shoot is from the middle of the screen to where the mouse is pointing
if ( Input.GetMouseButtonDown(0) )
{
HandleBullets();
}
}
Greetings