0
Answered

Dash/Dodge question

marjohloo 5 months ago in Game Creator updated by Marti (Lead Developer) 5 months ago 7

Hi I'm controlling my player with WASD, I would like Q to do a dash 45 degress to left from orientation of player and E similar but to the right of the player. I've experimented with the settings the best way I found (for the Q/left) is to add a empty object forward and left of the player and use it as a target (and can do similar for E/right) is that the best way or is there a shortcut?

Unity version:
2018.4.21f
Game Creator version:
1.1.6
GOOD, I'M SATISFIED
Satisfaction mark by marjohloo 5 months ago

And a supplimenary question, I've tried turning (by setting the driection towards the points I created) and was then going to do a dash but my player turns for ever (of course) is there a way to do something like this relative to the player's orientation?

Answered

It wasn't clear if you're using the Move To or the Dash Action. Just in case, be aware there's an Action called Dash that does this.

The idea of setting an empty game object on each side of the player and use it as the target looks fine by me. It doesn't have any performance impact and isn't cumbersome to do. In fact, it's great, since allows you to easily tweak the direction in case you later on want to move the character slightly on a different direction.

Not sure I understand though the direction part. You can try setting the Target Direction to the side the player's dashing towards, wait a few seconds, and reset the target direction back to "movement direction".

Alternatively, you can use a custom animation that looks fine when dashing, even if it's with the body rotated 90 degrees.

Hope this helps! Let me know if there are any other questions, and if the latter wasn't resolved, feel free to share a video showcasing this.

I have an acceptable result using dash towards the points attached to and offset from the player but did want to refine it a bit. Because I'm new to GC (and Unity) I'll try to be careful in my terminology. Using adventure camera if that makes a difference to the control. 


What I would really like to do for dash/dodge is:

1. Rotate the player and movement direction and cameras 45 degrees left or right of where the player is currently facing/travelling.

2. Use a dash forwards - so the key press also affects direction of movement, but I realise that may clash with how the camera/general control works

I've tried a few things here if I do a rotate (of the player) the camera does not rotate and with the forward key still pressed the player then rotates back, should I be rotating the camera instead of or as well as the player?

What I have at the moment is:

1. Dash towards object the points attached to the player in fron at 45 degrees

2. The camera remain behind (the player is not rotated)

3. Direction of travel is the same as before the key press

And after typeing and recording all that figured out camera rotate does what I want!

So now I think I prefer my original and sorry for spamming, if you are still interested here are the alternatives: https://youtu.be/VwgNIn2nlEo

Happy to hear you solved it :-) I'm closing the issue then