pdiddles03 Posted February 8, 2018 Share Posted February 8, 2018 does anybody else have an issue with jittery movement while setting the y velocity to make a character jump? Link to comment Share on other sites More sharing options...
JackFalcon Posted February 8, 2018 Share Posted February 8, 2018 No jitter, Here is some key jump code .. if(keys.jump.preJumpMode){ //prejump moveY = 0; if(onUp || inUp){ upJumpMode = 1; } } if(keys.jump.jumpMode){ //jump moveY = (keys.jump.jumpIndex<=1)? 0.8 * oScaleFactor :(keys.jump.jumpIndex<=4)? 0.6 * oScaleFactor :(keys.jump.jumpIndex<=6)? 0.4 * oScaleFactor :0.2 * oScaleFactor ; keys.jump.jumpIndex++; } if(keys.jump.fallMode){ moveY=-0.5; } Some simplified interpolation using a ternary operator. There was a significant process used to step-debug jump anomalies for ... things that made perfect sense... but were difficult to predict, during testing. For example: stop turn animation on jump animation... that caused a Jitter - because two animations at same time. SUGGESTION: To find the jitter... 1) try to set debugger; directly before it begins the jitter... 2) if you can do that -you can fix any complex animation anomaly. 3) step through until you see where it goes wrong... 4) usually it is something obvious that is hard to predict. 5) fix is usually very simple, like adding a if(jumpMode) then turnAnimation = 0. etc... Hope that helps. Link to comment Share on other sites More sharing options...
pdiddles03 Posted February 10, 2018 Author Share Posted February 10, 2018 I'd say this is not the answer. This does not solve the problem of the built in velocity issue Link to comment Share on other sites More sharing options...
Recommended Posts