Skip to main content

Questions tagged [coroutines]

Coroutines are software components that generalize subroutines for cooperative multitasking. They are suited for asynchronous (or non-blocking) programming and allow program execution to be suspended and resumed.

3 votes
1 answer
148 views

I'm trying to implement a robust pause system in Unity and I'm confused about the correct approach. My first (very simple) implementation in my previous project used a ...
Curio's user avatar
  • 261
2 votes
1 answer
421 views

Consider a situation where a coroutine in node A awaits a signal from node B. If node B gets freed without sending the signal, obviously the coroutine in node A will never finish executing. Does it ...
Carl Muckenhoupt's user avatar
0 votes
1 answer
81 views

My code has a function ...
Usylom's user avatar
  • 31
0 votes
1 answer
145 views

I'm making a game and when the enemy dies I keep it in memory. I want the person playing to find the game just as they left it when they enter. I'm doing most of these, but there's one small problem ...
Volkan AKDAG's user avatar
1 vote
0 answers
214 views

I am looking at wrapping functionality from an external C++ library with GDExtension for use with Godot 4. Many of these functions have an appreciable runtime before they return the values of interest,...
R.M.'s user avatar
  • 141
-2 votes
1 answer
113 views

I am trying to make a coroutine private in Unity. I have tried declaring it as a private method, but it still seems to be accessible from other classes. Here is an example of the code I am using: <...
Alex Junior's user avatar
1 vote
1 answer
188 views

I am making a system where I have one long audio clip made up of voice lines which I want to be able to play one after the other with a variable pause in between. I press the space key to start the ...
Michael's user avatar
  • 51
0 votes
1 answer
180 views

Good Afternoon, I'm trying to move three objects from their current position to a shared target position based on speed. Once they reach the target position, they move to a shared respawn location and ...
PayasoPrince's user avatar
0 votes
3 answers
525 views

My problem: I am using a coroutine to add a typewriter effect to my texts, but the delay (using yield return new WaitForSeconds();) isn't consistent on different ...
DemonicTree's user avatar
11 votes
1 answer
4k views

While reading a thread about coroutines, I stumbled upon a random user's comment that coroutines may not fire at all: Just so you are aware, there is a coroutine limit and if you hit this some ...
Saturn's user avatar
  • 1,763
0 votes
0 answers
428 views

in the code linked below, i am using bepinex and harmony to make a plugin for the game Sons of The Forest the goal of the code attached is to log the value of an in-game variable every second, but the ...
naenae baby's user avatar
0 votes
1 answer
175 views

I just wanted to fact check myself on a scenario where the player may be locked out of input. With this example, there is a chance that the player's input will not be received if they happen to press ...
PayasoPrince's user avatar
0 votes
2 answers
2k views

I have made an up and down movement RPG prototype and I wanted to have a fighting system. I made it so that the enemy follows the player and that I get damage every time he collides with me. The ...
Hammynator's user avatar
0 votes
0 answers
975 views

I've gotten used to using coroutines as a way to ensure a things are done sequentially in my code, i.e. instead of calling method a, method b, and method c on back to back lines I will sometimes yield ...
Kyle34562345's user avatar
0 votes
1 answer
463 views

I am new to making games with Unity. I am trying to damage the enemy. So far, the damage works. The problem is it will repeat it until the enemy is dead, but I want it to damage the enemy only once. <...
Spectral's user avatar

15 30 50 per page
1
2 3 4 5
7