Questions tagged [async]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
40 views

How does the Asynchronous Upload Pipeline actually work?

Unity has an Asynchronous Upload Pipeline which can upload qualifying textures and meshes to the GPU asynchronously over several frames, rather than uploading in one frame and stalling the main thread....
Kevin's user avatar
  • 5,734
0 votes
0 answers
66 views

Application.WaitForAsyncOperationToComplete() causes game-freeze in Editor

I'm creating a pause menu for my game and I have two scenes: a menu scene (Scene1) and a game scene (Scene2). I load them using the command 'SceneManager.LoadScene(1);' for the menu scene and '...
AshwinTheGammer's user avatar
1 vote
0 answers
539 views

Scene loading finishes (90%) in 1 frame, but isn't isDone until 3 frames later

I am loading scenes async using addressables like so ...
complex problem's user avatar
1 vote
1 answer
311 views

How would you write a multithreaded gameloop in C++20 (+) or C++/WinRT?

What are the pros/cons of using either C++20 std:async or C++/WinRT's asynchronous thread and messaging support? What would the code look like when implementing multithreaded game-loops that ...
elika kohen's user avatar
0 votes
0 answers
70 views

Cancel a task only if it gets re-run

I have a slow proc gen function that runs when a user changes any parameters. If a parameter is changed before it has completed, I want it to cancel the task and start a new one. Currently I have it ...
arcadeperfect's user avatar
0 votes
3 answers
316 views

How to make a text-based game with timer systems

This is an interesting question I have, so I ask you to hear me out. No, I'm not just going to ask "how do I do this" and hope someone will give me code. I've been programming for a long ...
Rowan McAlpin's user avatar
0 votes
0 answers
595 views

how to make pausable/resumable tasks using c#?

first of all im not using unity. it's a Signalr .Net Backend Program that runs turn-based multiplayer games. I use c# async methods to make multiplayer scenarios. for example, the player has 10 ...
virtouso's user avatar
  • 2,608
0 votes
0 answers
903 views

AsyncGPUReadback.RequestIntoNativeArray - owner has been invalidated

I have the following C# code in Unity version 2022.2.0a12: ...
Corvus Ultima's user avatar
1 vote
1 answer
204 views

UI mask and elements not visible after Async scene change

i have an async loading scene system that redirects to a loading scene and then to the target scene. The function works properly although i found out that some UI elements dont work directly on scene ...
stratos la's user avatar
2 votes
1 answer
1k views

Animate Loading Screen During CPU-Heavy Scene Load

I have a scene with lots of lightweight objects and one that takes anywhere between 10 and 45 seconds to load. At a high level, the Awake method does... Query database For each result do some (fairly ...
Basic's user avatar
  • 1,267
3 votes
2 answers
5k views

Preload multiple scenes at the same time and activate them on demand in Unity. [Unity, async, simultaneous]

Preload scene in unity - this question tells us about how we can pre-load a scene in Unity and load it on demand. What it doesn't tell us - how do we pre-load multiple scenes at the same time and also ...
Candid Moon _Max_'s user avatar
11 votes
2 answers
14k views

Should I use Async & Await, instead of Coroutines, in Unity?

Should I use Async & Await in Unity? Or should I keep using Coroutines? If I should use Async & Await, how can I do so in a manner comparable to Coroutines?
Evorlor's user avatar
  • 5,793
2 votes
2 answers
1k views

Using Async Await in Unity

I am trying to make a reload mechanism in Unity, but the function is in a scriptable object. This means I cannot use Coroutine as it is in MonoBehaviour. I could think of solving with a simple timer ...
66Gramms's user avatar
  • 135
1 vote
0 answers
91 views

Binding Lua Function to Perform tasks using std::async

I am trying to load a bunch of mesh resources in the format of .obj files. Some of the files are very high in poly count so when loading using the below method It takes more than 10 seconds. I would ...
JJerome's user avatar
  • 11
0 votes
1 answer
60 views

My script to play the intro scene the first time the player hits play from the main menu wont work

The script I am using determines if it is the players first time hitting the play button and if it is it will load the intro scene, but if they have played before it will take them strait to the game ...
Ethan K-B's user avatar
0 votes
3 answers
709 views

Instead of using yield wait for seconds can I use a UI button for async?

the code below is the code I use to load my game scene ater the intro animation plays. The way it works is that it preloads the game scene because it is big enough it takes time to load and activates ...
Ethan K-B's user avatar
-1 votes
2 answers
4k views

Unity is single thread then why unity webgl says asset bundles are load in main thread

Got stuck in a performance issue in Unity WebGL that whenever my asset bundles are load, my unity game gets freeze for some seconds/minutes. I know that unity is not thread-safe and it is based on a ...
Muhammad Faizan Khan's user avatar