NavMeshPlus icon indicating copy to clipboard operation
NavMeshPlus copied to clipboard

How would I snap the movement to a 8 directional system?

Open RUGMJ opened this issue 2 years ago • 3 comments

Im making a game with this library and was wondering how to make my enemy's movement look like the player's, I have everything setup and working fine, I just need to make the movement stick to those 8 directions how could I go about doing this?

RUGMJ avatar Mar 30 '22 18:03 RUGMJ

nevermind, found a souloution, I just needed to disable auto braking and set the acceleration to a overly high amount (mines at 1000)

RUGMJ avatar Mar 30 '22 18:03 RUGMJ

Hello @RUGMJ

How does 'disable auto braking' and 'acceleration' makes agent to snap the movement to a 8 directional system?

I would glad to include this trick into wiki.

h8man avatar Mar 30 '22 19:03 h8man

Hello @RUGMJ

How does 'disable auto braking' and 'acceleration' makes agent to snap the movement to a 8 directional system?

I would glad to include this trick into wiki.

By itself it doesn't, but if you round the transform.position values with Mathf.round it has that effect

RUGMJ avatar Mar 31 '22 07:03 RUGMJ