playMaker

Author Topic: Character jitters when going downhill  (Read 6842 times)

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Character jitters when going downhill
« on: November 06, 2013, 07:48:17 PM »
My character controller is coming along, but I've noticed one issue. When moving downhill on a flat plane, the character jitters between touching the ground and "falling". This affects character controls slightly, but the main problem is visual - the character looks like it's rollerskating down a set of stairs (even though it is a smooth incline).

I've tried changing the step height and slope limit, but no luck. Any ideas?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Character jitters when going downhill
« Reply #1 on: November 07, 2013, 02:01:58 AM »
Hi,

 Is it not your physics material on your ground of player that is too "sticky"?

bye,

 Jean

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Character jitters when going downhill
« Reply #2 on: November 07, 2013, 01:47:36 PM »
I don't think the material on the hill is too sticky - it seems like the characters forward momentum is prioritized over gravity. The forward motion carries the player horizontally forward, at which point the game realizes the character is in the air, gravity is applied, the character falls, and the forward movement then continues, the character is suspended again, falls again, etc. This happens many times while walking down an incline.

Making gravity stronger lowers the amount which the character moves forward before gravity is applied, and make the jittering much faster (more repetitive).


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Character jitters when going downhill
« Reply #3 on: November 08, 2013, 12:54:11 AM »
Hi,

 yes, and if you make your ground more "icy", then it will not "bounce" and create this effect. have you experimented with the physics material at all?

bye,

 Jean

Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Character jitters when going downhill
« Reply #4 on: November 11, 2013, 01:58:43 AM »
Hi Jean,

I spent some time working with this issue. I added a new material to the collider on my downhill slope, and changed the various properties (bounce, friction, etc) and the problem still persists.   :-[

The only solution I've found is to set the gravity to an insanely high number - 8000. This causes the character to smoothly walk downhill, but the camera still jitters during this transition. I could add a delay/smooth to the camera, and change the gravity to a reasonable number when the character jumps.

I'm still thinking there's got to be a solution in the way the Playmaker FSM handles the character's grounded state. I'll keep poking around and let you know if I'm able to find a solution!


Breadman

  • Full Member
  • ***
  • Posts: 185
  • Derp
Re: Character jitters when going downhill
« Reply #5 on: November 11, 2013, 02:07:35 AM »
I've found a script which targets this issue (in addition to many others):

http://wiki.unity3d.com/index.php?title=FPSWalkerEnhanced

The page does an excellent job of describing the issue I'm facing:
Anti Bump Factor: An amount used to reduce or eliminate the "bumping" that can occur when walking down slopes, which is a result of the player constantly toggling between walking and falling small distances.

I'll try to take apart the script and see if I can integrate it into my project!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Character jitters when going downhill
« Reply #6 on: November 11, 2013, 02:47:17 AM »
Hi,

 Nice finding! Keep us updated

bye,

 Jean