Platform Riding - Unwanted vertical trembling/shaking

koozek

  • Posts: 9
Hey, Guys!
I'm implementing a Platform Riding behaviour, right now, and I have the problem that the Player always seems to jitter/shake by 1 Pixel when he's standing on the platform that's moving upwards (especially when it moves downwards). I noticed it in other Stencyl games, too, like this one (http://www.stencyl.com/game/play/10859).
Is this a known bug with the physics engine, maybe? Is the collision detection "too slow"?
I'd really love to know. Thanks in advance! :-)

« Last Edit: January 10, 2014, 04:07:15 am by koozek »

koozek

  • Posts: 9
Okay, no solution for the vertical movement, yet, but I think I know the root of the problem that also leads to my Player not sticking to the moving platform.
My Platform Moving behaviour uses the "Slide to/by" block which doesn't seem to use a speed value but rather moves the actor manually step by step, I suppose. I debugged and it looks like the platform's speed is 0.
Hmm, I guess I have to rewrite the platform motion code :/

Clunger

  • Posts: 11
I had a similar problem.

Are you changing the position of the rider based on the position of the platform?  Are they both non-sensor actors?

If so, I think the jittering is caused by the collision system.  Every time the player's position changes, it slightly overlaps the platform.  This causes a tiny collision reaction.

I'm not sure how practical it would be for your game, but my solution was making a specific animation for riding.  This animation was set to a sensor, which stopped the collisions thus stopping the jittering.

koozek

  • Posts: 9
Hmm, that sounds plausible. Not based on the position but I'm giving the player the same speed as the platform while standing still. I will keep your method in mind. I'll try figuring out how to make my approach work first, though.
I'm using "Set speed to" now, instead of "Slide to/by" for the platform and now the player stays on it when moving horizontal, but only in some weird circumstances. Like only after I walked a bit or saved or whatever. Totally arbitrarily, aaargh :D I'm so happy when this will finally work as it's supposed to!

Clunger

  • Posts: 11
I tried speed and position, and they both get the jitters.  Mine was inconsistent too.  It drove me crazy for awhile too.

If you can find a solution that doesn't involve making either the player or the platform a sensor, let me know.  If you want to try making the platform a sensor, I'll can help.