Search Unity

Unity animation - Cull completely vs Cull transform with hundreds of objects

Discussion in 'Animation' started by mrCharli3, Sep 4, 2020.

  1. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    976
    I am making a game with a lot of animated AI, somewhere around 500 active AI at a time. This works great so far.

    My one issue is how much performance animating uses up. My issue is with culling, take the scenario below:

    I have 20 units off screen that chop wood, if I cull comletely I cannot use animation events because they will not get triggered while culled, so I use cull transforms. I always prefer using animation events instead of using some timer in the code that calls ChopWood() at a set interval, I find it produces a lot of messy code.

    I tried comparing performance between cull completely and cull transform and didnt notice any huge difference when using 200 agents.

    So I am wondering if anyone has experience with this scenario and can warn me of any pitfalls I might encounter using animation events for this many agents. Will it end up killing my performance? Is it unreliable? If so, how did you solve it?