Player Movement Glitches After Changing to Cinemachine Virtual Camera

Prior to removing the original Follow Camera, my player’s movement was smooth when holding the mouse button down. Now, however, my player’s movement stops and starts intermittently when the mouse button is held down:

Glitch clip sm 0001-0320

Here is a screen grab of the camera’s inspector settings:

Here’s a screenshot of what it looks like in the game view:

On the extreme off-chance that it was a navmesh problem, I cleared and rebaked the navmesh, and here’s what it looks like through the area my player is moving through in the screencap above:
Screenshot 2021-09-18 210526

There is a section of my dirt path where the player should run to the right, however, it gets to a point where it comes to a complete stop and no matter where I click it won’t move further along the path.

Any help would be appreciated!

In the video, it looks like one of two things is happening:

  • The Input system is losing the mouse status
  • The mouse position isn’t over a section of NavMesh

Unfortunately, at the resolution fo the video, it’s impossible to see where the mouse is. (It may be that your screen recorder leaves otu the mouse anyways).
You can test for the mouse status easily, however.
Put the following Debug.Log at the beginning of your Update() method in PlayerController

Debug.Log($"Player's mousedown is {Input.GetMouseButtonDown()}");

Thanks for the reply! I tried the line and it logged out the mousedown as staying True through each of my guy’s little fits and starts. As you can see in the screenshot of my original post, the navmesh is solid on the ‘road’. On my retest with the new debug line I held my mouse steady in one spot just above the avatar’s right shoulder (keeping it on the ‘road’ texture). I got super frustrated because the fits and starts kept happening anyway, so shut my computer all the way off and walked away for a few hours.

Turns out it must’ve been a windows issue with unity - after a restart of my machine it works fine with no changes made to navmesh or code. :woman_shrugging:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms