Sprinting Failure :(

Hiya Everybody! :smiley:
So, I attempted at making a sprint control thing for my character.
When pressing “W” (to move forwards) and holding “Left Shift” (Run/Sprint)
everything is fine… but when releasing Left Shift the character stops dead
in his tracks and get held back for about a second. To explain thing more porperly
and stuff, I’ve included this file.

Walk forwards, then at the green section hold shift (With “W”) and release Shift
at the red section. You’ll see what I’m trying to explain.
Thanks :smiley:

there seems to be alot more going on in this blend that just the problem you are trying to isolate, for starters. would you mind constructing just a plain cube as the character, and a large enough ground plane to run on. then from this sample try to construct the isolated scenario, logic bricks and such. and if your having problems still… post that very basic example, and then we can get straight to the point of what your doing wrong in this situation. Honestly though, your current file is kinda confusing, so i have to file it in my round file, sorry ;^)

Here is the simplified version:

this is a much easier file to look at and deal with. having said that i am not sure what is wrong, so hopefully someone will know more, but i will post my findings.

your 3rd set of blocks for stop? seemed to do nothing so i removed them. for your “sprint” sensor(left shift) i keep this connected, but removed first modifier and linked “run” through “and1”, i don’t know if your way or this way is better, because neither get the results you want, but i just thought i would share my findings and what i did to try to make this file work.

so yes, everything is fine until you release the left shift, and unfortunatly the only way i could remedy this was letting go of the w key first( i assume this is not the behavior that is desired. )

since it is servo i thought it was just applying force , and maybe the difference of force creates a vector and that is the “hickup/lag” we see. thinking this, i noticed your local is not clicked as in the little “L” button to the right of the linear Vel settings. this kinda changes everything, and i think this is more correct? but i am not positive.

with your current set up, if you let go of W, then left shift, no “hickup/lag”, but i am not sure everything this should tell me/us.

so in the motion actuators, i also clicked “L” in both for local Linear Vel, and clicked “Y” and set a max of 3 in “motion” and a max of 10 in “motion1”
doing all this above gets the object to stop the lag hickup, but the applied force doesn’t help it slow down as you would probably like it. so it lead me to thinking that another actuator is needed to apply negative force for when the “W” key is replaced.

does that make sense?

i will work on it some more and let you know what i find, sorry i couldn’t be more help yet.
hopefullysomeone who really knows what they are talking about will lend a hand…

I don’t really use logic bricks a lot so this could be wrong or inefficient but this might work

Attachments

Failure Of Death(1).blend (520 KB)

This bouncing back is a problem of the servo motion less of your logic. (just increase the forward component of the “run” actuator and you will see the same thing.

Unfortunately I have no solution to this as I use the servo motion not that match.

The “stop” brick is there to stop the character from sliding when releasing ‘W’.

It does indeed work, thank you scuba111223! :smiley:

I love the way you name your stuff. :slight_smile:

That’s good RandomPickle97 :slight_smile: I don’t use logic bricks like this often, I’m glad it works somewhat :slight_smile: