HOW TO MAKE A DASH MOVE IN UNITY - EASY TUTORIAL

  Рет қаралды 228,606

Blackthornprod

Blackthornprod

Күн бұрын

Пікірлер: 422
@nejcpetric7590
@nejcpetric7590 6 жыл бұрын
I like how every-time you introduce a new function, you announce it like it's some sort of big reveal lol.
@anyshittynickname
@anyshittynickname 5 жыл бұрын
Since I'm a complete beginner, new functions are always a big reveal, hahaha
@celestemackaill6375
@celestemackaill6375 2 жыл бұрын
@@anyshittynickname I feel this. Started scripting in unity today. You still going?
@anyshittynickname
@anyshittynickname 2 жыл бұрын
@@celestemackaill6375 Yes. At the moment I'm doing audio for a game as a freelancer, so I don't have the time to work on my individual projects (First step will be finding out what game I'll do next).
@celestemackaill6375
@celestemackaill6375 2 жыл бұрын
Do you feel comfortable with things now because it sometimes feels like I will never be able to feel comfortable with unity code. Well I am a lot better than when I sent that message. But still it's feels far away.
@anyshittynickname
@anyshittynickname 2 жыл бұрын
@@celestemackaill6375 I went to grad school, had to do some audio coding and level design with Unity. The bulk of code was made by my classmates, but I can read variables, understand if statements and create coroutines with some skill. It's literally a language. I got rusty for lack of practice, but I got some of the fundamentals fixed in my mind, no doubt about that.
@dharmeshkumar2763
@dharmeshkumar2763 6 жыл бұрын
Oh i expected the same dash effect as thumbnail. But i really like the camera shaking via animation. It's amazing without writing any code.
@evanrechsteiner518
@evanrechsteiner518 6 жыл бұрын
I've wanted a proper tutorial on this for what seems like and probably is years. Your focus on simple tutorials that are easily digestible are one of the reasons I subbed. Keep it up!
@VictoriaStobbie
@VictoriaStobbie 6 жыл бұрын
I think you're my new favorite tutorial person. I've been looking for a few months for a dash tutorial. And here you are, after watching the Light tutorial.
@xdiatia4197
@xdiatia4197 4 жыл бұрын
I went to your channel and the subscribe button was far off the screen!!!!
@VictoriaStobbie
@VictoriaStobbie 4 жыл бұрын
xDiaTia Aww cheers haha. Sorry about that 😅
@JW-uu9je
@JW-uu9je 5 жыл бұрын
Thank you for this Blackthorn prod! For anyone who's interested I noticed that this spawns a clone into your scene every time you use this, I created a co routine to destroy the object after 1 second has elapsed everytime you push the button: ...whatever code you have the dash effect in { ... ... Instantiate(dashEffect, transform.position, Quaternion.identity); StartCoroutine(DestroyParticleEffect()); } IEnumerator DestroyParticleEffect() { yield return new WaitForSeconds(1); Destroy(GameObject.Find("ParticleEffect(Clone)")); //the name in " " must match the name of your prefab, notice on the console how unity ads (Clone) to it }
@Bes2TheFort
@Bes2TheFort 6 жыл бұрын
An idea for your next tutorial. Can you make a screen transition from when the player dies and comes back to life.
@floppy9053
@floppy9053 6 жыл бұрын
It's now out btw
@siltoruz3502
@siltoruz3502 4 жыл бұрын
If you guys want to make this script work side by side with your normal movement script, instead of creating a dashSpeed variable in the Dash script you need to make the normall moveSpeed variable in your Move script public, call it from the dash speed and add more velocity to it there. Also if you want this to be working on button press, you need to put the input next to the direction check: void Update() { if (direction == 0) { if(Input.GetKey(KeyCode.LeftArrow) && Input.GetKeyDown(KeyCode.Z)) { direction = 1; } This will check if LeftArrow is being pressed and dash when Z is pressed too Took me a while to figure this out but feels good :P
@bahadrdogan3734
@bahadrdogan3734 3 жыл бұрын
thx man
@ishaanjuyal212
@ishaanjuyal212 2 жыл бұрын
Thanks! This was really helpful :)
@ezramin8238
@ezramin8238 2 жыл бұрын
thx, really helps
@Durpydogstudios
@Durpydogstudios 2 жыл бұрын
thx
@wasdolgaming6718
@wasdolgaming6718 Жыл бұрын
I know this video is old and this comment too but i need to say this... I do it another way... When ever you hit button left arrow or right arrow or up arrow or down arrow the PlayerMovement script is disabled, and when ever you hit W or A or S or D your PlayerMovement is enabled :)))) I call it: the Laziest way to do it...
@1206Vince
@1206Vince 6 жыл бұрын
Yessssss was waiting for this!
@tiui2371
@tiui2371 6 жыл бұрын
Nice tutorials as always, I havent been programming much, but that "direction" is way more easely done by: Getting the input (vector 2); Doing an atan2 function; ( mathf.Atan2(x,y) ) (store that) And finally just apply it the way you did.
@vizion4724
@vizion4724 2 жыл бұрын
I know it's an old comment but I believe that the the Atan2 function uses y before x, so like ( mathf.Atan2(y,x) ) instead of ( mathf.Atan2(x,y) ).
@tiui2371
@tiui2371 2 жыл бұрын
@@vizion4724 Yeah, that makes sense, I didn't actually test the code I suggested, so you're probably right. Thanks for pointing that out!
@randomuser1249
@randomuser1249 3 жыл бұрын
Your never fail to make me cry I’ve been struggling on this for weeks and granted I didn’t try very hard but I had no clue ok don’t bully me
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
You do great job!
@AlexanderZotov
@AlexanderZotov 6 жыл бұрын
Thanks)
@beaverjoe9171
@beaverjoe9171 6 жыл бұрын
Both of you do great jobs!
@lhorbrum1818
@lhorbrum1818 6 жыл бұрын
Hello Alexander! Two of my favourite youtubers! Keep it up guys.
@bunggo9914
@bunggo9914 6 жыл бұрын
some 2d particle system turorials would be great! anyway, the effects you're using for making the dash moves feels alive are really cool!
@tessler9710
@tessler9710 6 жыл бұрын
This video was quite awesome. Seeing that it's possible to create something beautiful without that much experience is quite motivating to do something.
@what_the_feek5568
@what_the_feek5568 6 жыл бұрын
hey bro.... big new fan of yours.... actually you are really good...you are my 2nd favorite unity developer after brackeys.... I really love your editing style...those small small animations and sketches... big way to go man... All the best and have a good day.
@reywasgrey
@reywasgrey 6 жыл бұрын
Farook Shafeek if I, prefer this channel
@seamusfraser4679
@seamusfraser4679 5 жыл бұрын
I'm not sure if this is a problem on my end but this dash move doesn't seem compatible with the movement script you prescribe in your videos.
@franklimburns7938
@franklimburns7938 5 жыл бұрын
Yeah I Know have you figured out how to make it work?
@AdirBenYair97
@AdirBenYair97 4 жыл бұрын
Doesn't work for me too :( any solutions?
@GlassChewer
@GlassChewer 4 жыл бұрын
@@AdirBenYair97 use Addforce instead of velocity
@albinsamuelsson2179
@albinsamuelsson2179 4 жыл бұрын
@@GlassChewer doesn't work
@ElS3rna
@ElS3rna 4 жыл бұрын
that is because it takes the same inputs and overlaps, I cant find how to make it work either :(
@seifmustafa2004
@seifmustafa2004 6 жыл бұрын
I just can't express how much I like you tutorials 👍👍😁💟
@Blackthornprod
@Blackthornprod 6 жыл бұрын
Hey Seif :) ! That's so appreciated !
@thetoastedmarshmallow1606
@thetoastedmarshmallow1606 6 жыл бұрын
Is there a was to make normal movement possible but when you press... Like... Space you dash in the last direction you were facing?
@skiesquiggles7319
@skiesquiggles7319 5 жыл бұрын
If you store keypresses in a temporary variable then you should be able to infer direction from that.
@starrynightchannel
@starrynightchannel 5 жыл бұрын
What i did was summon the last direction your character was facing using GetComponent and then in my direction 1 if statement i created an if statement with. If (otherscriptmoventright.IsFacingright) Rb.velocity =Vector2.left * dash_speed Then u can modify if going left or right
@uba754
@uba754 5 жыл бұрын
I am currently really struggling with this. I've got it to dash towards the mouse position but it goes to basically the exact position, not just direction. I want it to dash a set amount not a short dash because mouse is close to the player or big dash because mouse is far.
@brokenbackisbad9049
@brokenbackisbad9049 3 жыл бұрын
Blackthornprod to the rescue
@Oxmond
@Oxmond 4 жыл бұрын
Great tutorial idea! Dash moves are cooooool! 👍🤓
@cassdy91
@cassdy91 6 жыл бұрын
Never seen anyone so excited making a unity tutorial video lol
@mogaolimpiu7190
@mogaolimpiu7190 4 жыл бұрын
i just started making games, and i just love your tutorials, thnank you
@derekanderson5949
@derekanderson5949 5 жыл бұрын
Doesn't work
@MaydoFX
@MaydoFX 6 жыл бұрын
Great tutorial! However, changing the direction from int to Vector2 and using Vector2.Zero instead of 0 would drastically reduce the code and make it much cleaner. Good job still :)
@howl2339
@howl2339 2 жыл бұрын
Why not use input axis for dashing?
@FanJapanStudios
@FanJapanStudios 6 жыл бұрын
Just Shapes and Beats!!
@JackFrost-1856
@JackFrost-1856 5 жыл бұрын
What if I want to make the character dash on pressing Space while I'm moving the player around manually? Help pls
@anyskurosaky7951
@anyskurosaky7951 5 жыл бұрын
If you find anything on that please let me know ! :)
@josh1234567892
@josh1234567892 5 жыл бұрын
@@anyskurosaky7951 this
@BikramKha1sa
@BikramKha1sa 5 жыл бұрын
Me too need answer for this...
@adamknight4563
@adamknight4563 5 жыл бұрын
Hi, don't follow this tutorial on dash move, it's not good. What I do is on my PlayerMovement script, I put a line of if (Input.GeyKeyDown(KeyCode.Space)) { StartCoroutine ("DashMove"); } Then outside of your Update method, make a courotine like so: IEnumerator DashMove() { PlayerSpeed += 20; yield return new WaitForSeconds(.3f); PlayerSpeed -= 20; } Obviously you can add instantiating effects and screen shake into the sprouting as he has in this video as you please. What you're doing here is once you hit space, you are increasing your speed by 20 in this example for a third of a second (that's where the WaitForSeconds(.3f) comes in) then you will reduce your speed back to whatever you increased it by.
@angelitoc
@angelitoc 5 жыл бұрын
@@adamknight4563 Hey do you have a twitter or any sort of social media I have some questions for you
@gauravpun6749
@gauravpun6749 6 жыл бұрын
This is very helpful ! Thanks !!
@The_Pikaboi
@The_Pikaboi 5 жыл бұрын
i was messing around with this and it didnt seem to do anything in my platformer, just moved at the same speed.
@mirageowl
@mirageowl 5 жыл бұрын
you are probably changing velocity of the rigidbody in your normal movement as well. make sure you are running this script after your movement script takes place so that this one takes control.
@kaiser6594
@kaiser6594 5 жыл бұрын
same
@AdirBenYair97
@AdirBenYair97 4 жыл бұрын
@@mirageowl Thank you! that is the problem for me, but i dont know how to fix it. how would you do it?
@ze_darku_magician5504
@ze_darku_magician5504 4 жыл бұрын
@@mirageowl Thats exactly what i have probably done wrong. Could you maybe explain how to set the order your scripts are running?
@beautaeful
@beautaeful 4 жыл бұрын
did you find a fix for it?
@Heisenberg-xc8ub
@Heisenberg-xc8ub 6 жыл бұрын
"Making your own games is easier than you think"
@wickedalpha9810
@wickedalpha9810 6 жыл бұрын
for anyone who is really confused on the anim controller part here is the script using System.Collections; using System.Collections.Generic; using UnityEngine; public class DashMove : MonoBehaviour { private Rigidbody2D rb; public float dashSpeed; private float dashTime; private Animator camAnim; public float startDashTime; private int direction; void Start() { rb = GetComponent(); dashTime = startDashTime; camAnim = GameObject.Find("Main Camera").GetComponent(); } // Update is called once per frame void Update() { if (direction == 0) { if (Input.GetKeyDown(KeyCode.V)) { direction = 1; } else if (Input.GetKeyDown(KeyCode.C)) { direction = 2; } } else { if (dashTime
@howl2339
@howl2339 2 жыл бұрын
GOSH YEAH
@fourty2223
@fourty2223 6 жыл бұрын
Hey Noa , is there any way i could put this dashing system together with a common player controller? i tried to do it but it looks like te common player controller disables the dash system.
@Blackthornprod
@Blackthornprod 6 жыл бұрын
Hey :) ! Make sure you aren't using the same keys for both the dash move and the "normal" movement. For example don't get the character moving left with the left arrow AND dashing left with the left arrow. If you're using the rigidbody to get the character moving make sure that there isn't some line of code : rb.velocity = Vector2.zero constantly running. The easy fix to that is making a bool variable called isDashing for example and setting it equal to true when the character hits a dash key and set rb.velocity = vector2.zero ONLY if isDashing is equal to true :), and when that line of code as been run set isDashing back equal to false, this way vector2.zero won't constantly stop your character moving ! Hope this helps !
@SebaneseTheLebanese
@SebaneseTheLebanese 6 жыл бұрын
Blackthornprod hey there! can you please make a video showing how to dash like cuphead? or send me a picture of a script with what i need? please I need this for my game im submitting to hopefully get a scholarship so i can go to college
@Tealsquiddev
@Tealsquiddev 6 жыл бұрын
@@SebaneseTheLebanese you would want to make a longer startdashtime and you want to have it at a slow-ish speed
@SebaneseTheLebanese
@SebaneseTheLebanese 6 жыл бұрын
@@Tealsquiddev thnxxx
@happytatertot8624
@happytatertot8624 3 жыл бұрын
Help, I keep getting NullReferenceExeption: Object reference not set to an instance of an object. :(
@reywasgrey
@reywasgrey 6 жыл бұрын
I really love your tutor 😍😍
@ibrahimbaasil9707
@ibrahimbaasil9707 3 жыл бұрын
Very nice tutorial, code works perfectly. But I have been trying to add a cooldown to the dash so the player cant spam it. Any idea on how I can achieve this? (I'm a beginner at code btw)
@chickenfrenzy9096
@chickenfrenzy9096 5 жыл бұрын
How can you make it a double tap. I have movement but I want the dash and the movement.
@Gamer-uf1kl
@Gamer-uf1kl 5 жыл бұрын
public int countToTwo = 0; void Update() { if (Input.GetMouseKeyDown(0) { countToTwo ++; } }
@Gamer-uf1kl
@Gamer-uf1kl 5 жыл бұрын
And then continue the script like if (countToTwo == 2) { Dash(); countToTwo == 0; }
@sunnysommanek1648
@sunnysommanek1648 6 жыл бұрын
great job!, i really like your video.
@1206Vince
@1206Vince 6 жыл бұрын
Is a combo system on your schedule? Like if a button is pressed once, animation 1 is playing. But when the button is pressed multiple times, the animation sequence will start
@Blackthornprod
@Blackthornprod 6 жыл бұрын
The combo video will DEFINITELY come up some time in the next two weeks :) !
@AgeRestrictTheInternet
@AgeRestrictTheInternet 6 жыл бұрын
@Blackthornprod Did this video ever come out? If so, what's it called? I can't find it.
@zakihussainqureshi9793
@zakihussainqureshi9793 6 жыл бұрын
Awesome stuff.... Keep making more please... Thank you brother
@geekscave7405
@geekscave7405 5 жыл бұрын
anyone knows how to make it with a double tap function?
@deadshxll
@deadshxll 4 жыл бұрын
use ur logic and u will figure it just like I did
@hxmr-kc2fh
@hxmr-kc2fh 4 жыл бұрын
@@deadshxll that doesn't helps dude.
@deadshxll
@deadshxll 4 жыл бұрын
@@hxmr-kc2fh here’s what can help you, use your brain and try to write code, in the end you will figure out if you are capable of not copying and pasting code from other people. Here’s a hint to help you make the double tap function, you need to time to check in between each click, it is a bit complex but if you think of how you can build it then it should be a breeze
@thomaswalsh4882
@thomaswalsh4882 3 жыл бұрын
@@deadshxll you dont have to be so rude
@beaverjoe9171
@beaverjoe9171 6 жыл бұрын
!!!!O! You REALYLY MADE IT!!!! I wished you can made on the last vedio under comment!!thanks!!!!!
@Blackthornprod
@Blackthornprod 6 жыл бұрын
Hey :) !! No problem, it was a great tutorial topic !
@franklimburns7938
@franklimburns7938 5 жыл бұрын
I tried adding this to my platformer game. However it is not moving my player when I try to dash. tho I know its working because I used a Debug.Log line and that is working. But I dont know what to do to make it actually move. Some help with this would be appreciated. Thanks
@goodgamershow6505
@goodgamershow6505 3 жыл бұрын
absolutely the same problem here
@dizzyhungry
@dizzyhungry 3 жыл бұрын
I appreciate the tutorial This guy is way too excited lmao
@zerg230
@zerg230 6 жыл бұрын
For some reason, Vector2.left and Vector2.right do not work(but up and down yes). Do you have a clue, why? Edit: It has to do something with being in Update(). Edit2: For some reason, rb.AddForce(Vector2.right * dashSpeed); worked.
@Demigodish4o3
@Demigodish4o3 6 жыл бұрын
Hey, I am having the same issue right now. Was it being in Update a problem? Should it be in FixedUpdate instead? Thanks! EDIT: Answered my own question! Sorry haha
@zerg230
@zerg230 6 жыл бұрын
Glad it helped :)
@barsubata
@barsubata 5 жыл бұрын
@@Demigodish4o3 Just changed it to FixedUpdate and it worked. Thx you both! :P
@mrfabi5943
@mrfabi5943 4 жыл бұрын
Hm, my movement code (moveInput = Input.GetAxis("Horizontal"); //movement rb.velocity = new Vector2 (moveInput * speed, rb.velocity.y); //movement) seems to not work with that, ill try around a little bit and let you know
@mrfabi5943
@mrfabi5943 4 жыл бұрын
Alright, so I just replaced my previous movement script with this one and it worked perfectly fine, I guess it was messing with the "rb.velocity" function. var horizontal = 0; if (Input.GetKey(KeyCode.A)) horizontal = -1; if (Input.GetKey(KeyCode.D)) horizontal += 1; transform.Translate(horizontal * speed * Time.deltaTime, 0, 0);
@LoonyJustLoony
@LoonyJustLoony 4 жыл бұрын
Спасибо за ролик, похоже я одна из русских, которая заходит на англоязычные уроки. Знаю, что вы наверное не поймёте, но все равно скажу, что ваша информация намного полнее, чем у русских видео. Your video is cool!
@mhack071099
@mhack071099 6 жыл бұрын
Dude you are the best !
@EmesZack
@EmesZack 5 жыл бұрын
As someone using Character Controller, how can i apply this dash?
@OryamBibi
@OryamBibi 5 жыл бұрын
i need an answer for this too
@OryamBibi
@OryamBibi 5 жыл бұрын
I have an answer just switch keys lol to something like a and q
@linshu6141
@linshu6141 4 жыл бұрын
"" This Comment is from Blackthornprod from another comment. "" Hey :) ! Make sure you aren't using the same keys for both the dash move and the "normal" movement. For example don't get the character moving left with the left arrow AND dashing left with the left arrow. If you're using the rigidbody to get the character moving make sure that there isn't some line of code : rb.velocity = Vector2.zero constantly running. The easy fix to that is making a bool variable called isDashing for example and setting it equal to true when the character hits a dash key and set rb.velocity = vector2.zero ONLY if isDashing is equal to true :), and when that line of code as been run set isDashing back equal to false, this way vector2.zero won't constantly stop your character moving ! Hope this helps !
@SageNode
@SageNode 4 жыл бұрын
didnt work. all you did was make the normal movements replaced by a dash. how do i apply this to a single Dash button in any direction?
@Skikopl
@Skikopl 4 жыл бұрын
You can do it by if(Input.GetKeyDown(KeyCode.A) && Input.GetKey("KeyCode.LeftShift")) This way if you hold A and Press Shift WHILE holding A it will dash in the direction of A if you have a playercontroller.
@kingdaygaming8461
@kingdaygaming8461 4 жыл бұрын
Does this tutorial work for 3D?
@xavierwastaken6891
@xavierwastaken6891 6 жыл бұрын
So the problem with instantiating a particle system every time you hit a dash button is that the particle system will not be destroyed after the particles stop playing. Anyone know an easy way to destroy the particle system object after like a second or so?
@xavierwastaken6891
@xavierwastaken6891 6 жыл бұрын
If anyone is interested I did this in my script by adding the following code GameObject clone = (GameObject) Instantiate (particleSystemName, transform.position, Quaternion.identity); Destroy (clone, 1f); Essentially destroying the cloned particle system after 1 second (1f is the duration in seconds)
@johnsmith-nx9ne
@johnsmith-nx9ne 6 жыл бұрын
was about to reply with this very code snippet before you replied to yourself :P good job though
@cacnus
@cacnus 5 жыл бұрын
Late, but can't you just set it to autodestroy in the new version of unity
@walteralmeida7064
@walteralmeida7064 5 жыл бұрын
This tutorial is great! many thanks! But I just wanted to know a thing. How would I do for the dash to be activated by a specific button (shift for example) AND a diretional arrow at the same time?
@marcoterlizzi7326
@marcoterlizzi7326 5 жыл бұрын
Use the && function. For example: if(Input.GetKeyDown(KeyCode.LeftArrow) && Input.GetButton("Shift"){ You can also create a bool which activates when you press shift. For example "bool ShiftPress = true" in that case it would be if(Input.GetKeyDown(KeyCode.LeftArrow) && ShiftPress) hope this helps :)
@walteralmeida7064
@walteralmeida7064 5 жыл бұрын
@@marcoterlizzi7326 I SEE! MANY MANY THANKS!!!
@ImD3VI
@ImD3VI 2 жыл бұрын
how would this work with a topdown using rotation as well.
@human_being_who_exists4989
@human_being_who_exists4989 5 жыл бұрын
I know this video is old but the animation controller didn't work. I just got an error whenever I tried to use the cam shake.
@dormeod8027
@dormeod8027 5 жыл бұрын
If you do it in a platform game i think its better to check where the character is looking while you hit a button it can save some time in the long run
@aegresen
@aegresen 6 жыл бұрын
Thanks for this amazing tutorial! Would you be willing to do a video on the camera shake in detail? I tried doing it but to no avail since the camera started shaking the moment I began playing the game!
@vedeopoka4495
@vedeopoka4495 6 жыл бұрын
Impressive......... keep going........
@chammi_desu
@chammi_desu 5 жыл бұрын
I tried this tutorial and found that the game object does not dash a uniform distance whenever I use the ability. I can't quite tell why or if there is a pattern, but it seems random. For context, I'm trying to use this script to implement something similar to the Hollow Knight mothwing cloak mechanic. I placed two platforms within dash distance and made my cube character dash from side to side. However, after a few dashes, the object is unable to dash that distance. And another instance, the object dashed further than the platform. Anybody else facing the same issue?
@mirageowl
@mirageowl 5 жыл бұрын
this is using the update method which may run during random times in a second. using FixedUpdate may solve the issue. Detailed explanation: What this script does is move the player dashSpeed amount of units each time update is run until time between the running update and the first time the dash started becomes larger than dashTime. This means it may take 1 frame for 0.1 seconds, moving 50 units for example, or it may take 2 frames for 0.1 seconds because the engine wasn't as busy and move 100 units.
@gamefist1329
@gamefist1329 5 жыл бұрын
alternatively you could use a coroutine
@FrostshadowStudios0310
@FrostshadowStudios0310 4 жыл бұрын
This'd also help if I want a character to teleport (like the Hollow Knight Dash, except instead of the character turning pitch-black, they go invisible)
@D4rkS7der
@D4rkS7der 6 жыл бұрын
Hey thanks for tutorial, I am new to Unity (but not programming whatsoever) and I learn a lot thanks to your tutorials. I have suggestion (or question maybe) to your code. I would find a bit more readable (or shorter? more effective?), to start direction variable from zero. All the direction vectors could be stored in private array and in if statement (dashTime
@tristancowen5636
@tristancowen5636 6 жыл бұрын
soooo coooooool. as always, keep up the good work
@chinyonglim7624
@chinyonglim7624 6 жыл бұрын
Hi, Noa Some people using velocity like you did in this video, but there are people use 'transform.position = Vector2.Movetoward(from, to, speed)', or even using AddForce to move an object/player. Is there any good example/scenario to demonstrate the proper way of using these method?
@Blackthornprod
@Blackthornprod 6 жыл бұрын
Hey :) ! These are all great methods ! I would use Vector2.MoveTowards for enemy chasing AI or patrolling, but there's no real reason why you wouldn't do it hear too :) (though you would have to write more code for the same result, on the flip side you don't need a rigidbody with MoveTowards()).
@dcry1003
@dcry1003 3 жыл бұрын
I didnt know you can make a camera effect using the animation *damn* also any idea how you can implement this into a UI button?
@Borgor_Eater
@Borgor_Eater 5 ай бұрын
does anyone know how to prevent inputs while using this method so someone doesn't flip or jump during it (for a 2d side scroller)
@uba754
@uba754 5 жыл бұрын
How do I get the played to just dash in the mouse direction instead of these 4 directions? I have gotten it to work where it dashes to the exact mouse position but I want a set size of the dash instead and just use the mouse direction.
@melvinbengtsen6953
@melvinbengtsen6953 6 жыл бұрын
Just something i thought you should know, Instead of using a bunch of else if statements you could have used a switch statement like so: Switch (direction) { case 1: rb.velocity = Vector2.Left * dashspeed; break; case 2: rb.velocity = Vector2.Right * dashspeed; break; Case 3: rb.velocity = Vector2.Up * dashspeed //and so on default: Console.WriteLine("NotDashing"); break; }
@valentintyteca5925
@valentintyteca5925 6 жыл бұрын
Thanks for that tutotial ! But i wanted to ask, if i want my character to dash where i point my mouse, how do i do please?
@creationJeuxVideoETtuto
@creationJeuxVideoETtuto 3 жыл бұрын
hello....j don't understand for so complexe.... me, with 3 lines of code, dash is possible... where is the subtility that j don't know?
@hackomordy774
@hackomordy774 5 жыл бұрын
Could you please tell me how to keep some time gaps between two dashes?
@feelgxxd
@feelgxxd 3 жыл бұрын
im STİLL trying to find how to make cooldown in dash...
@hackomordy774
@hackomordy774 3 жыл бұрын
@@feelgxxd you can use a boolean to store canDash... and use a timer script to enable and disable the canDash
@vicentezavala9274
@vicentezavala9274 3 жыл бұрын
Hey, I did it on a 2d platformer ans it works but only sometimes, like sometimes i press the dash button and nothing happens, it doesnt detect it every time, any ideas why?
@Ozetis
@Ozetis 3 жыл бұрын
i have a probleme. when i start the game, my player can't jump until i press arrows BUT the dash work only one time, when i press a other arrows, it's doesn't dash and my player can jump.
@leatherandpoemscharmyman5774
@leatherandpoemscharmyman5774 4 жыл бұрын
nice but how to do it for double tap an arrow keyboard for example? thx.
@Michael-The-Composer
@Michael-The-Composer 6 жыл бұрын
This is very nice!
@tymofii4718
@tymofii4718 3 жыл бұрын
if you want to dash in the direction the player is facing use direction = input++;
@Agent40infinity
@Agent40infinity 5 жыл бұрын
Honestly don't see how this is anything like Hollow Knights but cool.
@deveeyv7211
@deveeyv7211 3 жыл бұрын
Great and simple!
@gabrielpena9307
@gabrielpena9307 6 жыл бұрын
MAN! NICE TUTORIAL !!!!! THX YOU SO MUCH
@TheBaffledZone
@TheBaffledZone 4 жыл бұрын
The thumbnail has the crystal heart dash in it lol.
@gamefist1329
@gamefist1329 5 жыл бұрын
how would you make it so the dash script can work with a normal move script
@عزالدينبنعبدالرحمن
@عزالدينبنعبدالرحمن 5 жыл бұрын
make conditions detect both the movement button and the dash button like this : if(Input.GetKeyDown(KeyCode.LeftShift) && direction = 'D') {DoSomething();}
@rigzmoviediaries654
@rigzmoviediaries654 5 жыл бұрын
Thanks again noa
@Kaasbaas1234
@Kaasbaas1234 5 жыл бұрын
For me it sometimes goes further than others, i did use time.DeltaTime though so it can't be fps related :o
@Kaasbaas1234
@Kaasbaas1234 5 жыл бұрын
cheers
@diegocortes7806
@diegocortes7806 5 жыл бұрын
i just have the same issue, did you find out how to fix it?
@ARTHUR14523
@ARTHUR14523 4 жыл бұрын
Can you show the code?
@lhorbrum1818
@lhorbrum1818 6 жыл бұрын
I never thought about adding a screen shake via the animator. Does this have a major effect on performance at all? And if so, why? Thanks :)
@Blackthornprod
@Blackthornprod 6 жыл бұрын
Hey :) ! Nop no performance issues at all :) !
@EyesReye
@EyesReye 6 жыл бұрын
How would i make him dash diagonally?
@noellekkar903
@noellekkar903 4 жыл бұрын
Change the angle
@goodgamershow6505
@goodgamershow6505 3 жыл бұрын
just use Vector2.up
@scratchgames9986
@scratchgames9986 3 жыл бұрын
how can I make it so It calculates where the player is facing instead of the arrow keys being pressed?
@Faun471
@Faun471 6 жыл бұрын
What if I want to replicate Hollow Knight's dash system? Dashing wherever you're facing? What shall I change?
@hackomordy774
@hackomordy774 5 жыл бұрын
Use facingRight = true or false to do it....
@TheSilentNinja137
@TheSilentNinja137 6 жыл бұрын
Would this work for making a boost move?
@FutureYT
@FutureYT 4 жыл бұрын
I made a 2d platformer, and I want the player to dash when I press space in the right direction. How can I do it?
@takei5410
@takei5410 4 жыл бұрын
Can someone explain me why my dash works only when direction is equal to 1?
@creeperperson9019
@creeperperson9019 4 жыл бұрын
this might be late but the physics dont work with the dash, the only way i could dash is if i set the rigid body to kinematic and that will stop it colliding with other objects
@turoreal
@turoreal 4 жыл бұрын
How would you go about changing it into a switch statement?
@lituszx
@lituszx 6 жыл бұрын
Great Tutorial that helps a lot! thx!
@gordier6787
@gordier6787 3 жыл бұрын
i cant tell where anything is supposed to go because your curly brackets are arranged like a cat knocked them over
@t_hanos9834
@t_hanos9834 5 жыл бұрын
How would you make it that you have to press another button instead of the arrow keys to dash?
@narainkarthic.n.s7835
@narainkarthic.n.s7835 3 жыл бұрын
Hi, There I followed everything as you said but when the player is dashing if he touches a corner he shoots up into the air , Can anyone help me with this
@justinaccurate347
@justinaccurate347 4 жыл бұрын
Instantiating the particle system doesn't work, and I did the exact same thing as him
@TookAPhatShatProduct
@TookAPhatShatProduct 4 жыл бұрын
Dont know if this is too late but check the Dash script attached to your character and you can attatch the prefab to make it work
@mosley3485
@mosley3485 6 жыл бұрын
This code could do with a refactor. Firstly, you should never affect rb.velocity directly as it can lead to unexpected behaviour. You should use rb.AddForce to interact with a RigidBody. Also, this should be done in FixedUpdate, not Update, as you're affecting physics. There is also a lot of repetition in your huge if statement, which could be simplified. Input.GetAxis("Horizontal") gives a positive number for right input and a negative number for left input. You could handle all horizontal movement using Vector2.right and Input.GetAxis("Horizontal") as Vector2.right * dashVelocity * -1 would cause the player to move left. The same could be done for vertical movement, essentially halving the number of checks that you're performing and making the code easier to read.
@simonsvoboda8849
@simonsvoboda8849 5 жыл бұрын
@Ragnarok But what if you set rb.velocity to sth else in a different script, doesn't that cancel the first one (i'm pretty sure Noa sets rb.velocity to sth else in different tutorials)
@zubbag
@zubbag 4 жыл бұрын
Can I use this with 3D? Many thanks great vid 👍🏼
@alfiematthews3801
@alfiematthews3801 2 жыл бұрын
ive inputted the code but i dont know what key to press to actually dash
@ibrahemrafee2397
@ibrahemrafee2397 4 жыл бұрын
i want to make it that the dash last as the player hold the key (Like mega man type of dash) and be able to jump while the dash is active any Tips ???
@SujithEnigma777Soman
@SujithEnigma777Soman 3 жыл бұрын
how to dash in in south west and south east and north east and north west directions?
100 DEVS Make a GAME without COMMUNICATING! (76-100)
33:01
Blackthornprod
Рет қаралды 276 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
99% are using V0.dev wrong (Here is how you should use it)
6:22
Tobi Tackles Tech
Рет қаралды 2,8 М.
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
every step to actually make your dream game (then sell it)
24:27
They patched the game because of ME...
27:36
Real Civil Engineer
Рет қаралды 403 М.
Can You Beat Minecraft From One Grass Block?
35:27
Beppo
Рет қаралды 4,5 МЛН
Pixel Art Tips from a Professional Artist - Tips & Tricks
8:01
Goodgis
Рет қаралды 1,1 МЛН
Minecraft Without Jumping, but Auto-Jump is on…
15:08
GuyBordo
Рет қаралды 1,3 МЛН
How I Made a 3D Platformer in 2D Game Engine
21:23
ggenije
Рет қаралды 581 М.
I Made A Difficult Game About Climbing
15:04
Pontypants
Рет қаралды 2,2 МЛН
7 DEVS Make a GAME without COMMUNICATING! (500 IQ edition)
17:39
Blackthornprod
Рет қаралды 569 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН