Search Unity

Projectile: Transform vs. Physics vs. Particle motion, test results

Discussion in 'General Discussion' started by Razorwings18, May 7, 2015.

  1. Razorwings18

    Razorwings18

    Joined:
    May 8, 2014
    Posts:
    69
    I was doing transform-based motion for projectiles, and for a long time wondered how physics-based motion, or having a single particle shot using the particle system instead would perform.

    In case anyone was wondering the same, here are the results for the test I performed today.

    NONE OF THE PROJECTILES USE COLLISIONS FOR THIS TEST. In all tests I shot 20.000 projectiles spaced by 1 world unit for a fixed distance.

    Results using transform-based motion ("manually" moving the GameObject on every Update)
    Main thread stabilized around 36ms



    Results using particle motion (emitting a single particle with the Particle System)
    Main thread stabilized around 60ms



    Results using physics (a Rigidbody, with a single impulse force upon creation)
    Main thread stabilized around 800ms



    Here's the project, in case you want to perform the tests yourself (Unity 4.5). Just change the parameters of the TestMain script on the Main Camera object:
    https://drive.google.com/file/d/0B-hXiQEF-xHZY09VVms2X254NTA/view?usp=sharing