Suggestions for adding in bouncing to walk and clearing the command queue

Announcements, support questions, and discussion forum for Grid Controller.
Post Reply
VirtualLife
Posts: 2
Joined: Thu Nov 10, 2022 8:46 pm

Suggestions for adding in bouncing to walk and clearing the command queue

Post 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.
User avatar
Tony Li
Posts: 20708
Joined: Thu Jul 18, 2013 1:27 pm

Re: Suggestions for adding in bouncing to walk and clearing the command queue

Post 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.
DQHomicide
Posts: 7
Joined: Fri Jan 01, 2021 12:53 pm

Re: Suggestions for adding in bouncing to walk and clearing the command queue

Post by DQHomicide »

You can always hook into the ExitingPosition event and run a coroutine from there as well. Its fairly easy to implement.
VirtualLife
Posts: 2
Joined: Thu Nov 10, 2022 8:46 pm

Re: Suggestions for adding in bouncing to walk and clearing the command queue

Post by VirtualLife »

Excellent. Thank you for the quick reply. Good catch on the tapping vs holding.
User avatar
Tony Li
Posts: 20708
Joined: Thu Jul 18, 2013 1:27 pm

Re: Suggestions for adding in bouncing to walk and clearing the command queue

Post 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.)
User avatar
Tony Li
Posts: 20708
Joined: Thu Jul 18, 2013 1:27 pm

Re: Suggestions for adding in bouncing to walk and clearing the command queue

Post 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.
Post Reply