- Home /
Can u "bind" game objects together to increase performence in an explosion or traffic jam?
I have heard that the engine is bad at keeping track of lots of single game objects (in an explosion). Why is that when they are sharing the same material? Is that because the program needs to calculate all positions for each of them? And if so, is there not a trick to get around that? I was thinking of: instead of moving objects bind them together and move them by scaling the parent (for explosion). And in my Sci-fic scene where I have a lot of cars flaying around parent those who move with the same direction and speed. Is there btw a difference in performance when ur moving two parented cubes together or moving one gameobject that contains two cubes was because they "merged" together in blender. Thanks for any help.
Answer by ryanmillerca · Jul 23, 2019 at 04:55 PM
Hi there! There's a lot of ideas to unpack here. Unity has many features that address the types of things you're talking about, but my response can only be as direct as your question.... here are several items of interest that should address your needs!
DOTS is a new part of Unity that leverages multiple processor cores to compute lots of data at once, they even use an example similar to your image https://unity.com/dots you'll also hear this mentioned at ECS, Job System, and Burst Compiler, which are all components of DOTS.
Graphics.DrawMeshInstanced gets you more performance for rendering many meshes than multiple gameobjects in your scene would: https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstanced.html
Dynamic Batching (draw call batching) is a performance feature that makes rendering many similar items much faster https://docs.unity3d.com/Manual/DrawCallBatching.html
There is a technique called "Impostors" that allows you to draw many items at once in a more optimized way https://assetstore.unity.com/packages/tools/utilities/amplify-impostors-beta-119877
Thanks! So it doesn't matter in performance if two cubes move together by moving the parent or by making one mesh out of them in blender and move that ins$$anonymous$$d? @ryanreptoid