Page 1 of 1
Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Thu Nov 10, 2022 8:59 pm
by VirtualLife
Great work, 99% what I was looking for.
I wanted to add a bounce into the step so it's a more realistic walk. General suggestions on how to implement would be nice.
Also, when holding down a direction button and letting go, it keeps going for way too long. Eg: Hold rotate for a few and let go, it will make 3+ more rotations after letting go. I'm guessing the command queue is built up to far. Was thinking of onKeyUp, clearing or limiting the queue.
Coding C# since it came out, but fairly new to Unity.
Thanks.
Re: Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Thu Nov 10, 2022 10:03 pm
by Tony Li
Hi,
Thanks for using Grid Controller!
I'll add a head bob option in the next update. If you want to implement it in the meantime, you can subclass GridController.cs and override this method:
Code: Select all
protected virtual IEnumerator Move(Vector3 moveVector, CompassDirection moveHeading)
It's a
coroutine that moves the player to its new position over a move duration.
Good catch on the issue when holding down a direction button. I'll address that in the next update, too. It's a little more complicated than just clearing the queue on key up. If the player rapidly taps and releases the "move forward" key 10 times, it should queue up 10 "move forward" commands. But if the player has been receiving "move forward" inputs for a key that's held down, it should probably clear the queue on key up.
I'll aim to have those done and available in a downloadable patch early next week.
Re: Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Fri Nov 11, 2022 11:09 am
by DQHomicide
You can always hook into the ExitingPosition event and run a coroutine from there as well. Its fairly easy to implement.
Re: Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Fri Nov 11, 2022 11:13 am
by VirtualLife
Excellent. Thank you for the quick reply. Good catch on the tapping vs holding.
Re: Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Sat Nov 19, 2022 9:39 pm
by Tony Li
Hi,
Thank you very much for reviewing Grid Controller! The next version will be submitted Monday morning, so it should be available as soon thereafter as it gets out of the Asset Store team's queue.
Which classes would you like to see more comments on? ("All of them" is a perfectly valid answer, too.)
Re: Suggestions for adding in bouncing to walk and clearing the command queue
Posted: Mon Nov 21, 2022 3:37 pm
by Tony Li
Grid Controller 1.0.2 is now live on the Asset Store. It has a head bob option, and it clears the movement queue when releasing a held-down movement input.