#15 | IENUMERATOR & COROUTINE IN UNITY 🎮 | Unity For Beginners | Unity Tutorial

  Рет қаралды 47,660

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 61
@Tarodev
@Tarodev 2 жыл бұрын
Wow, I have been sleeping on your channel. I randomly chose this video to see what you're all about, and I really enjoyed it. Practical examples with lots of tips nestled within the explanations.
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
Hehe thank you, means a lot coming from you. 😊 You are the one I use as a "benchmark", when I imagine where I some day want to be "Unity scripting knowledge" wise. 🙂
@Tarodev
@Tarodev 2 жыл бұрын
@@Dani_Krossing Oh ♥ You've commented a lot on my content, and I always enjoy your take. Not sure why it took me so long to click your name. Your facecam setup looks fantastic, I really need to up my game in that department.
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
@@Tarodev Thanks hehe. 🙂 A eye melting spotlight 👁🔥, and a blue lamp does wonders. 😅
@TheGrimmy
@TheGrimmy 2 жыл бұрын
Ah man, this is SO helpful! I had these problems a LOT with my old code and I thought I just broke stuff along the way. I went back to try and fix it, but obviously didn't know about IEnumerators! Thank you so much for covering this with such a thorough explanation :D
@Ooga658
@Ooga658 2 жыл бұрын
Thank you so much for doing these. These videos are engaging, fun, and super easy to understand. I can't even explain how much this series has been helping me, can't wait for more!
@TheGrimmy
@TheGrimmy 2 жыл бұрын
This exact example is(I'm pretty sure) used in games like Celeste because players press space, an animation happens that teleports players forward and players obviously can't move during the teleport. It's a matter of 0.2-0.5 seconds, but it still happens, haha. Very interesting example!
@theUnfrench
@theUnfrench Жыл бұрын
Tried other vids to understand this. None were as clear and easy in their explanations as you are here. I appreciate the help 🤙
@windup247
@windup247 Жыл бұрын
This is so well explained, thank you Dani!
@shonixgaming3076
@shonixgaming3076 2 жыл бұрын
THANK YOU SO MUCH FOR THIS!!! I’m brand new to this and started making a run and gun 2D side scroller as my first game. I wanted my character to keep his firing arm up for a few frames after firing, while also keeping it up should the player keep firing it. I spent HOURS trying to figure this out, until I stumbled upon this. Finally solved my problem but also learned about coroutines. So thank you again. XD
@东皇太一-s4g
@东皇太一-s4g Жыл бұрын
ty, you teach is clear。 it help me
@crossing_lears
@crossing_lears 2 жыл бұрын
Thank you very much for this very good lesson. I used to ignore videos about coroutines but when you emphasized and explained that it improved game performance got me interested to it. You also explained it very directly, thank uou!
@TheDuccyGaming
@TheDuccyGaming Жыл бұрын
the only Dani Game dev that has a consistent upload schedule.
@peterkim9696
@peterkim9696 2 жыл бұрын
I love the way u explain things
@jaqjoestar1319
@jaqjoestar1319 Жыл бұрын
wow this was so helpful😍😍
@fezekasabelo1117
@fezekasabelo1117 Жыл бұрын
Love your videos sir
@SMMdarkpower
@SMMdarkpower 9 ай бұрын
THANK YOU SO MUCH FOR THIS!!!
@ninjaraeven
@ninjaraeven Жыл бұрын
Man your code videos are great Dani im learning a bunch. Thanks for the effort explaining this stuff its very apreciated :)
@HazardLaser
@HazardLaser Жыл бұрын
This was a very informational video! thankks so much for being better than my professors :p
@KonigTheV
@KonigTheV Жыл бұрын
Thank you!!! This video has helped me a lot.
@mateobriard1069
@mateobriard1069 2 жыл бұрын
Thanks a lot, you are greatly helping me and a lot of lucky people that found your video :)
@Another_me1808
@Another_me1808 Жыл бұрын
Very helpful explaination , thanks
@alessiodibella2003
@alessiodibella2003 Жыл бұрын
Very useful, thank you!
@anttiv7109
@anttiv7109 Жыл бұрын
I would love to hear more practical use cases for this.
@theBestTwin5321
@theBestTwin5321 2 жыл бұрын
Thank you so much for this!!! Great tutorial!
@anthony15601
@anthony15601 Жыл бұрын
You look like a combination between Elon Musk and Mr. Beast
@sytma9175
@sytma9175 2 жыл бұрын
Thank you so much for the tutorial
@mikaeltorres
@mikaeltorres 2 жыл бұрын
Really helpful! thanks!
@tohidulislam1905
@tohidulislam1905 2 жыл бұрын
thanks
@_Garm_
@_Garm_ 2 жыл бұрын
great and easy to understand tutorial :)
@bcd3321
@bcd3321 2 жыл бұрын
Do you do any conferences planned in the Copenhagen area?
@porit1023
@porit1023 2 жыл бұрын
Thank you so much!
@matiaslecaros
@matiaslecaros 2 жыл бұрын
good video thank u :D
@Brai-niac
@Brai-niac Жыл бұрын
How do you run coroutine out start, Ontrigger or update. I want to use a button to start a coroutine.
@nathanholmes3334
@nathanholmes3334 2 жыл бұрын
Hi there, I found your channel when I was looking for a place to learn C# and I watched the tutorial you made a few years ago and loved it it was great but I had a question that popped into my mind after I finished watching that series and that was how do I learn to code a players health system in unity or give the player a inventory system I want to make games but there isn't any tutorials that I can watch learn any of this I have seen other people code health systems or create a inventory system for the player like it's second nature so surely there's somewhere I can go to learn this can I get any recommendations please?
@krzheski
@krzheski 2 жыл бұрын
Great tutorial! Can you do a profile page tutorial for the login system please?
@nathanholmes3334
@nathanholmes3334 2 жыл бұрын
Also I am learning more C# on code academy if anyone was interested in where I am learning
@Sakach1
@Sakach1 Жыл бұрын
W tutorial
@madpingui5007
@madpingui5007 2 жыл бұрын
When you cancel the coroutine, the player has already gone through the disabling of the movement, so when you cancel the coroutine, the player stays still?
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
That's right, but in a coroutine such as that one in my example, you wouldn't cancel it mid way. 🙂 And even so you can't really hit the cancel key fast enough since we are talking 2 frames. But let's pretend you did set it up so you could cancel it, you would just add a line of code that enables the player movement again when you cancel the coroutine. It was really just an example in order to show off coroutines, and there are for sure 10 other better ways of doing something similar then the way I showed hehe. 🙂
@Analyzer_Games
@Analyzer_Games 2 жыл бұрын
thanks you
@Exizos
@Exizos 2 жыл бұрын
Completed all 17# tutorials that you've made and I learned how to apply data types and other stuff but I'm still sad because I just feel too stupid for scripting because I do really bad at math.
@georgehanna8768
@georgehanna8768 2 жыл бұрын
What about using invoke?
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
Coroutines provide better performance, and allow parameters, which invoke doesn’t. 🙂
@georgehanna8768
@georgehanna8768 2 жыл бұрын
@@Dani_Krossing Thank you!
@anythingpeteives
@anythingpeteives 2 жыл бұрын
You said that IEnumerator is part of .Net and that it allows the user to iterate through something. How does it know in this case that it is going to iterate through frames? Is that it's only purpose within unity?
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
IEnumerable in .NET is used to loop through a non-generic collections. For example classes or lists. Unity uses this feature so that we can create these "time delays". You can read more about it here: learn.microsoft.com/en-us/dotnet/api/system.collections.ienumerator?view=net-7.0
@senl9429
@senl9429 8 ай бұрын
I've been stuck in the debug coroutine for a day now and still can't find a solution. VS2022 says "flame not in modele" I have tried all the methods that can be found on the Internet, and I have also checked some communities. Can anyone help me. This is machine-translated.
@Mport-UK
@Mport-UK Жыл бұрын
If you need this to only play omce. Put in start and not in Update! :)
@Natsnok
@Natsnok 2 жыл бұрын
Great tutorial :) I wish you wold make a tutorial about public variables and the problem that some times the public variable is saved local in a other script. This is one thing no one could expane to me. But i think you could
@klaus117gaming
@klaus117gaming Жыл бұрын
Is it just me or Dani looks like Elon Musk?
@cm16533
@cm16533 2 жыл бұрын
to summarize, would you say the main use of a coroutine is to control the flow of code? It seems like whenever I see loops used in people's code, it is within coroutines.
@firepenguin9919
@firepenguin9919 2 жыл бұрын
Im new to coroutines in general, but I heard that they are also used for functions that would normally be in Update, but dont benefit from being called every frame. For example a timer in seconds. You could code that in Update but a coroutine skips all the unnecessary frames and just activates every one second. For a timer you'd use a while loop
@sebaferrari_tattoo
@sebaferrari_tattoo Жыл бұрын
ienumerator not found
@wearwolf4202
@wearwolf4202 2 жыл бұрын
How can you use a coroutine when someone enters a trigger like onTriggerEnter, or onTriggerStay?
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
Just use the StartCoroutine() inside the OnTriggerEnter function :)
@lorshim7669
@lorshim7669 2 жыл бұрын
Hello sire My you make videos with return item when customers want to refund in php
@Dani_Krossing
@Dani_Krossing 2 жыл бұрын
Sorry but I don’t do much more in PHP tutorials. 🙂
@gctsquaternion6510
@gctsquaternion6510 Жыл бұрын
Thanks Unity's Elon Musk
@gasfeesofficial3557
@gasfeesofficial3557 10 ай бұрын
Are you Elon Musk?
@EchoVerseVR
@EchoVerseVR 9 ай бұрын
he built like drunk elon musk
Unity async / await: Coroutine's Hot Sister [C# & Unity]
16:18
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Music Video)
2:50
RAAVA MUSIC
Рет қаралды 2 МЛН
Coroutines in Unity (how & when to use them)
12:35
Game Dev Beginner
Рет қаралды 32 М.
Best practices: Async vs. coroutines - Unite Copenhagen
42:54
Better Coding in Unity With Just a Few Lines of Code
15:27
Firemind
Рет қаралды 319 М.
Unity Coroutines - What? Why? How?
11:03
One Wheel Studio
Рет қаралды 46 М.
OPTIMIZE your Unity game using these performance tips | Tutorial
11:20
Sasquatch B Studios
Рет қаралды 24 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
C# IEnumerable & IEnumerator
25:15
Tarodev
Рет қаралды 36 М.
I Wish I Had Known This Before I Started Unity Game Development...
11:11
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.