Howdy everyone,
So, over the last two days I have been struggling to implement a dash mechanic in my fast paced FPS. No matter how many YouTube video tutorials, guides and forum posts I read, I can't seem to figure something that's working for me... so I was hoping you could help me <3.
Essentially what I am trying to achieve is that I want the player to be able to dash in whichever direction I am double tapping, for example:
- Double tapping W would make the player dash forward relative to where they are aiming
- Double tapping W while holding D would make the player dash 45 degrees to the right relative to where they are aiming
- Double tapping D would make the player dash to the right relative to where they are aiming
- You get the idea...
It sounds simple enough, but I just can't figure it out for the life of me. I should maybe have mentioned that I am not much of a programmer. In fact I am not a programmer at all, I am mostly a musician and I like to draw and write too. I am having a lot of fun learning Godot but it is also incredibly overwhelming. Mathematics are my kryptonite too so... there's that also, haha. I am so desperate to find a solution T^T.
Thank you in advance for your help =D!
!!! BUT... I feel like my code might be very inefficient. Do you think it should be optimized ? Here is what I wrote :