Question: Dodging

Hi everyone! I’m having trouble implementing dodging in my game. What happens is when the player holds shift, it stops checking for movement and starts checking for pulses in a separate if statement. Anyways, I don’t know how to go about moving the player a certain amount after a pulse. I can’t use force or linear velocity because I’m using character physics, and I tried to animate the player box, which just snaps him into the center every time (which makes sense just I hoped that it wouldn’t do that). So I feel like the only way to do this is to make some kind of delay sensor or timer or something, and shorten the time of movement like that, but I’m not sure how to go about doing that. Any ideas?
Thanks

keypress (dodge this way)—and--------------add value to (this dodge)
(shift)------------------------------/
if value rage---------------------/

if value !=0------------------and----------------add -1 to value
________________________-----------------Do Stuff

IMHO, the character physics suck, there IS a wrapper you can get into with python, but you are always going to have to involve counter-measures to keep it from sliding and you cant use force the way you want, your better off using dynamic. At least you can use friction and forces. You may to do a little more tweaking, but you have more control.

@BPR Lol thanks but you and your diagrams haha! I often don’t really know what you mean sorry.

@superflip well the two primary reasons why I want to use character physics is a) The character doesn’t slide on the surface, which I don’t have a clue how to fix with dynamic, and 2) The step height seems like it would be very useful, as everything always (as far as I’ve experienced with Blender) falls off of slopes like terrain or ramps. Also, the easy jump/number of jumps is very useful. I don’t know much about all the fancy stuff like going into blender’s guts or making stuff that’s supposed to do one thing do a different thing (sorry if that makes no sense - it’s because I don’t even know what I mean… heh…), so I thought character physics would be awesome.

When I have an animation that includes movement, to prevent it from going through walls, I use linV in servo motion for the # of frames that it takes.

Maybe it can be simplified but:

I add a master bone that does this movement in linear interpolation. Animate everything, then I note down the frames where it moves and how much distance it covered, erase the master bone’s animation so that it remains still before using that animation in game.

Then I translate the Master Bone’s displacement over to the bounding box.

For the moving value on one axis, I calculate the number of frames per second / by the #of frames of the animation * by the distance the player moved.

Duration is # of frames / fps

So 2 blender units for 15 frames out of 60fps
Make that a property that lasts for 0.25 seconds or 15/60 seconds. With a movement of 8bu or 60 / 15 * 2

With the right friction it equals pretty much the same distance as your animation and it will be kept from going through bounds unless it’s way too much distance in too short of a time.

Ok thanks but I dont think linV works on character physics

keypress(logic brick)-----------and-----------set value to 30
if value=0-----------------------/

if value min: 1 max:30---------and-----------motion
___________________________----------add - 1 to value

(this will move over the course of 30 frames)

uploading video and files now

Oh my gosh… I think that’s exactly it! Thanks!

blueprint does your method work with servo motion too?

yeah, it’s just a timer,

Do X while value !=0