Why is my Player game object not rotating with mouse movement in 'Survival Shooter' unity project

I’m a beginner to Unity trying to learn the ropes by taking the tutorial courses hosted here on the site.

I’m on the 9th phase of the course and have worked without any hitches so far.

However I downloaded the standard assets folders from the asset store this morning and on returning to the survival shooter scene on my PC found a couple of game object had their tags removed and the Player object no longer responds to mouse movement.

Please what may have gone wrong and how do I get the player to follow the mouse again?

12 Days in and boy does my head hurt… =O)

Pretty unoriginal but I am just adding to this (i.e. no credit except my amazing screenshot) cuz it was annoying me AND I didn’t import assets or mod the script as someone else found…soooooo…something seems to be toggling the behavior. In any case, if you are in the “Survival Shooter” Tutorial and lost your playerToMouse click on the Game Object Floor under Hierarchy and check the Layer drilldown is set to Floor.

50385-1.jpg

Thanks Sara, the problem was that the floor quad of my scene lost its layer when I imported the new assets to the scene. Correcting that solved the problem. Thanks :slight_smile:

Had the same problem. Deleting the FLOOR object, and then creat it again, helps ME.

I had the same problem and I solved it (maybe)!

Change “Main Camera” direction .

  • Rotate Main camera and Look down Player.

Good luck.

This is my turning function and it seems to work fine:

    void Turning() {
        Ray cameraRay = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit floorHit;
        
        if (Physics.Raycast(cameraRay, out floorHit, cameraRayLength, floorMask)) {
            Vector3 playerToMouse = floorHit.point - transform.position;
            playerToMouse.y = 0f;
            
            Quaternion newRotation = Quaternion.LookRotation(playerToMouse);
            playerRigidbody.MoveRotation(newRotation);
        }
    }

@OP THANK YOU!!!
@kevinmorrisone Screenshot was perfect too. Thanks!

This turning function is also not working … please helpppppppp

When creating the floor Quad, make sure it has a Scale.Z value of 1 and not 0.

Scale x=100, y=100, z=1 <----- I thought this was trivial since a quad has no height but… collision won’t work if 0.

Spent whole day to debug that… :S

There might be an issue with the orientation of the main camera.
Just change the view to the top mode and you will be able to see the movement.