this post was submitted on 10 Aug 2023
27 points (96.6% liked)
Game Development
3483 readers
53 users here now
Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Async/await and Tasks in Unity. They basically work similar to Coroutines, but without the boilerplate code required.
I'd even say that Tasks and async is better in most of the cases you'd use a coroutine for - the main difference is that Coroutine is tied to framerate, and is guaranteed to be executed every frame (unless you yield something that waits longer), which is something you can't do with Tasks. But most of my Coroutine usage is tied to WaitForSeconds, and that's where Tasks are IMO better suited.