Unity Do’s and Don’ts

Mobile optimisation can be a pain, but here are a couple of things I’ve picked up regarding colliders (especially for a 2D platformer).

Static Colliders
Static colliders as you may or may not know, are colliders without a rigidbody. The number one rule with these is that you never, ever, move them. Ever. Even if you are moving them through code, you must always have a rigidbody on the game object. This is very expensive to do otherwise and especially on a mobile device, you may notice a massive drop in the framerate.

Static Gameobjects
Speaking of static, ever noticed that little tickbox up in the top right of the inspector? Well, anything whose transform, scale or rotation never changes should always be ticked as static. This saves the CPU a lot of calculations, bringing a noticeable increase in performance.

So if you’re game’s framerate seems to drop, or overall performance seems sluggish- before you start redoing your art assets or redesigning your levels, make sure to check these first!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>