I’m trying to implement a dash system in my third person game. So far I’ve got it to the point where the player can dash in the direction that they’re moving however there’s an issue at lower speeds. I’d like the player to be able to dash from a standstill/low speed but due to how the vector is calculated it looks like I can only do it via a modifier. So 0*250 still results in a dash distance of 0. Is there any way for me to add a base value to the dash distance?
you can use animation notify state
override tick function and addactorworldoffset …
why not use animation notify state ?
I’m not familiar with that so it might work but I’m not using any animations atm, it’s just a cylinder since I’m trying to get movement down first. Would an animation notify state help even though I’m not using animations?
how about just using a select node. you could for instance get the velocity then check if the velocity is equal to zero, then if it is use a static value all done in the select node. you could do the same basic thing in many areas of your script. anyways i made a small example below which could be injected into your script between the get velocity and the multiply node. it should do the trick for you.
I tried to implement this but it doesn’t seem to be turning over any results, should I be leaving the false node blank?
I’m thinking there might be a solution tied to normalizing the vector
Using normalize vector and adding a float to it worked for very small velocities but there’s still no movement at a velocity of 0
the false node is the number you want to use for your velocity when the player isnt moving. you said that you want you dash to happen even when the player isnt moving but you were having a problem because it was multiplying by 0, so the solution i presented was to multiply by something other than 0.
you will need to find the right value to input to get your desired outcome. i imagine velocity is in local space but not sure off the top of my head. but yea all this script really does is set a minimum dash.
Use your actor forward vector if your velocity is < 1 length
Thank you for all the replies. In the end I wound up figuring out an acceptable solution on my own. I’ve posted the BP to show my solution. For those of you who are having difficulty with vectors of 0 you can do what Harry suggested and use something related to the actor in order to produce a vector. I’d gone with ActorRotation but I imagine actor forward vector would work as well (maybe they’re the same thing I don’t know).