I would like to create a directional dash to the direction that the camera is facing for a set distance(maybe i can change that to charged with min-max values?who knows).im as new as it gets to using ue4 so i would appreciate any kind of help
A basic solution would be something like this in your Character blueprint.
Get the world rotation of your camera â Get Forward vector. This essentially gives you a âDirectionâ the camera is facing in. Multiplying that vector by a value will âgrowâ (scale) the vector, so this is the distance you want the dash to cover. Then you can use the Launch Character node.
If you want to âchargeâ it just increase the float amount given to grow the forward vector, for example âOn Pressedâ could set a boolean to true, and âOn Releasedâ could set the boolean to false, in your Tick Event check if the boolean is true, and if it is then it could go something like (ChargeAmount * DeltaSeconds * ChargeRate). Just be sure to reset it when they release after launching them. If you want a min/max then you can use a Clamp node on that float.
Here is an image example for the basic setup (without the charge).
Thanks ill try it and return asap to tell you if it worked.thanks for the answer either
way
I dont know how to create the âdash distanceââ float.without that part its just smaller jump btw.can you please help?sorry for bothering you for such simple stuff
ok i got i just had to make my own float(first time i do thatâpat-patâ).thanks,it works only like a charm.only thing left to figure out is how to still go the distance if im slightly facing the ground ,which currently leads to a smaller-distance-dash
Right click the âreturn valueâ on GetWorldRotation and the âIn Rotâ on Get forward vector and click âSplit Struct Pinâ on both, try it with only the Yaw connected to the otherâs Yaw, removing the pitch should solve that, however you probably donât need the roll either. Give it a go.
I got everything up and running.also added ignore gravity and friction during the dash so i can travel a set distance no matter where i am facing.also used stop-move and set movement to fix the end dash behavior.you were really helpfull
please check another question i got about a grappling hook cause its driving me crazy.hf
Glad you got it working! Donât forget to accept the answer if youâre satisfied with the solution.