Hot answers tagged

2 votes
Accepted

Any way to copy data into a component in another thread?

It's probably not the copying that's taking the time, but the updating of the rendered polygons and collision detection acceleration structures in response to the newly-copied data. Since those ...
user avatar
  • 114k
2 votes
Accepted

How to move an object when a specific event occurs?

I am not a fan of coroutines, because they make it hard to reason what actually goes on in the code. I prefer to use a pattern like this: ...
user avatar
  • 112k
1 vote

Trying to generate a Tile labyrinth in Unity

It is a solid block of walls because you tell it to generate a solid block of walls. ...
user avatar
  • 2,350
1 vote

Animation of front and back part of a prefab separately on unity

I actually found how to do it by myself. On the animation window, click on "Add property" > the name of the child object (in my case, frontpart) > "SpriteRenderer" > "...
user avatar
1 vote

How to move an object when a specific event occurs?

Sounds like what you are looking for is Coroutines. Basically, you would write whatever code you want to execute in a function that returns IEnumerator, like this: <...
user avatar
1 vote

How to use Unity job system to do background work spanning multiple frames?

EDIT The Jobs based answer below can work. But for anyone who has use case I had (one expensive level generator algorithm to run in background rather than many parallel ones), just using Async/Await ...
user avatar
1 vote

Efficient way to detect when audio clip ends

isPlaying will also return false if the song gets paused via. Pause. Therefore I'd recommend waiting for the ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible