Building A Stealth Game — Using The Mouse For Movement

Photo by Pixabay from Pexels
The “Static” checkbox is in the upper right corner
The Bake tab of the Navigation window
The Nav Mesh Agent component

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

RaycastHit raycastHit;

if (Physics.Raycast(ray, out raycastHit)) {}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store