#Getting a Dodge/Dash Mechanic to work/look right

13 messages · Page 1 of 1 (latest)

crisp prism
#

Trying to implement a Dodging/Dashing Mechanic similar to Unreal Gold 1998 or like Doom Eternal and I just can't figure out how to get it to "throw" the player in a direction in a meaningful speed.

attached is how I'm currently doing this, at the moment no matter how much I increase the Input Multiplier its only ever nudges the Player in the desired direction

any ideas and how I can make this better?

rich wyvern
#

What if you made them jump a little too, instead of just moving in the x? I'm wondering if floor snap or friction is the issue. And then maybe other code in the player is messing with velocity as well. Just ideas.

proven moth
#

Hi @crisp prism You want to try adding forces to the player rather than adjusting velocity. Remember this is a physics process. For example if something is jumping you add a force to push them up and gravity then brings them back down e.g. add_force(offset: Vector2, force: Vector2)

rich wyvern
#

So, this is a RigidBody3D based character? If so, then what spidermint says is true.

crisp prism
#

I'm using a CharacterBody3D for added context

#

had some outside help I figured out I needed to add a move and slide() to the script to actually apply to velocity

shell jay
#

i don't see a move and slide

#

are you moving

#

ah ok nvm

crisp prism
#

yeah this is the updated script

#

and how the result looks atm