- Home /
Dynamic Batching breaking by transform.position?
I am experiencing a curious problem.
I have a bunch of simple quad objects (2DToolkit sprites) using the same atlas. When I run the game, batching seems to work and my drawcalls stay at around 30-40 as I display more of these objects. I actually have an object pool of 300, which are instanced at the beginning, so I am just activating them so they display.
Now, if I add this line to my objects' update loop:
myTransform.position = newPosition;
the batching breaks and my draw calls linearly grow as I activate more objects from my pool. (the draw calls grow steadily from 40 to around 250+).
Commenting the line will make batching work again. But of course I need my objects to move around :) so I need to change their position.
Any ideas on how to correct this problem?
I experienced the same problem. For me, moving stuff along the Z axis in particular causes the draw call counter to go up. I don't get this at all...
Your answer
Follow this Question
Related Questions
Does it help performance to first check if some transform attribute has changed before setting it? 1 Answer
transform.position not setting position OR animation setting position even though it shouldn't 0 Answers
My code works but only with a waitforseconds() in a coroutine 1 Answer
(Unity3.3 standard)How to CombineChildren and keep Dynamic Batching? 0 Answers
Why scale break a batch? 1 Answer