Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RUGMJ opened this issue Mar 30, 2022 · 3 comments
Open

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

RUGMJ opened this issue Mar 30, 2022 · 3 comments

Comments

@RUGMJ
Copy link

RUGMJ commented Mar 30, 2022

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
Copy link
Author

RUGMJ commented Mar 30, 2022

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

@RUGMJ RUGMJ closed this as completed Mar 30, 2022
@h8man
Copy link
Owner

h8man commented Mar 30, 2022

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 h8man reopened this Mar 30, 2022
@RUGMJ
Copy link
Author

RUGMJ commented Mar 31, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants