ME FIRST GAMES
Menu

games for me and you

Unity - Secret Tips

10/14/2020

0 Comments

 
Here are some Unity3d tips that commonly slip through the radar.
📌 Scale your project correctly. It's important to have gravity and physics respond realistically when you have rigid bodies colliding or falling with gravity.
📌 Scale your 3d assets correctly. Chaos emerges if every 3d model imported needs to be scaled to a custom size in Unity. Ideally, assets should be scaled to 1, but with exceptions of course.
📌 Avoid Reflection. GetComponent, SendMessage, and Invoke are handy but not performant. Cache the result of GetComponent and avoid the latter.
📌 Lock your Inspector. Some actions require to keep an inspector window open while selecting other game objects, this can be accomplished by tapping the padlock in the upper right corner.
📌 Expose variables in your scripts using SerializedField instead of making everything public.
📌 Reverse an animation by setting the speed to -1 in the AnimationController state.
📌 Write your Gizmos inside your custom scripts. This may display the field of view and range for an AI-controlled enemy.
📌 SerializeField List<> will show in the inspector. I still recommend arrays for the default case, but if your container is going to change size over time, try using a List<>.
📌 Create your own class to manage time. Whether it's pausing, resuming, or slow motion, having a single class that controls Time.timeScale changes will make everything easier.
📌 Master the difference between Awake() and Start(). Awake() is invoked before Instantiate() returns and Start() will be called later during the frame after Awake() is called on everything else.
⭐️ Follow @mefirstgames for more #gamedev tips.
0 Comments



Leave a Reply.

    Picture
    Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
    GAMES HERE

    Red Matter

    Star Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.

    Archives

    April 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2019
    March 2019
    December 2018
    April 2018

    Categories

    All

    RSS Feed

Copyright (c) 2020 Me First LLC
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments