My "Dash" ability has a strange offset
I tried to figure out how to make dash ability on my own, and this is what came on my mind, il be showing you blueprint:
other part of blueprint is not that important but il show it too if someone needs:
it was just some checking wether there is enought mana to cast Dash and is it on cooldown or not...
What makes the problem here, is no next two pictures:
as you can see, i tried to dash in "Forward Vector" direction but my character is not moving right.
What could be the cause of this offset? is my question.
As you can see the Dash ability works, but after some iterations of DashKinda Timeline in blueprint my character is moving other direction. Also, the "Clones" as i called them is some kinda of image of TPCharacter,but they will be deleted if i set their "Set life span" to something like 0.2 seconds, as it was my intentional speed. But for the purpose that i can take picture i set it to 800.
Also, blueprint has no compiler errors.
asked Sep 12 '18 at 01:48 PM in Blueprint Scripting
your script seems a bit over complicated and there are a few errors that i can see right off the bat. one of the errors i noticed is that your not using set locations for your timeline, instead you are using a get actor location which will result in an exponential acceleration. well that is unless your timeline float * forward vector = 1. still though its not the way i would do things.
in the picture below you will see an example of how your entire system could be done aside from the ability cooldown. in the picture everything prior to the set initialLocation node is for checking the mana and decrementing it. the we set the players location so we have a static value to work from. next we use the timeline (which controls the dash duration) as a alpha for a lerp which controls the start and end point of the dash. last we set the location.
another way do do all of this would be to set the max walk speed which may actually be a superior method as it will handle turning mid dash better. in the end what ive shown here is similar to what you have but simpler, more organized, and easier to read. this may not completely answer your question but its an example of how you could accomplish what your looking to do.
answered Sep 12 '18 at 03:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here