Our new e-book, 70+ tips to increase productivity with Unity 2020 LTS, is now available. In connection with its launch, we’re writing a series of blog posts that highlight some of the time-saving tips and tricks you’ll get from this free guide.
While the first blog post focused on ways to speed up your workflows in the Editor, this second post pulls out some great tips meant specifically for artists. Don't miss out on productivity-boosting improvements available in Unity 2020 LTS to help you save time and focus on your core creative work.
In this post, we cover Prefab and animation workflows, working with Gizmos and icons, the Progressive Lightmapper, and more.
Make sure to fully leverage the workflow with Nested Prefabs and variants that let you build your scenes flexibly and efficiently.
Nested Prefabs allow you to parent Prefabs to one another. You can now create a larger Prefab, such as a building, composed of smaller Prefabs for the rooms and furniture. This makes it efficient to split your assets’ development across a team of multiple artists and developers, who can all work on different parts of the content simultaneously.
A Prefab Variant allows you to derive a Prefab from other Prefabs, much like inheritance in object-oriented programming. To change the Variant, just override certain parts without worry of impacting the original. You can also remove all modifications and revert to the base Prefab at any time.
Alternatively, if you want to change all of your Variants at once, apply changes directly onto the base Prefab itself.
Use Apply All to Base to propagate changes to the Base object or Revert All to undo the overrides.
See Nested Prefabs and Improved Prefab Workflows for more information about working with Prefabs in Unity.
TextMeshPro replaces Unity's UI Text and the legacy Text Mesh. It uses custom shaders and advanced text rendering techniques to deliver flexible text styling and texturing.
Use TextMeshPro to get access to features like character, word, line, and paragraph spacing, kerning, justified text, links, over 30 rich-text tags, support for Multi Font and sprites, custom styles, and more.
Working on a grid helps you fit your Prefabs together with less guesswork and greater consistency. Design your level so the pieces connect at scale, making it easier to rearrange and reassemble them.
If you are constructing your Scenes from modular assets, remember to use grid planes to align your GameObjects with each other. Rather than manually typing in round numbers into the Inspector, consider letting the grid snapping tools set your Transforms more quickly and precisely.
Unity provides three types of snapping to help you assemble your scenes quickly:
Combine Vertex and Surface snapping for quick placement:
Open the Grid and Snap window from either Edit > Grid and Snap Settings or from the grid visibility dropdown menu.
Need even more control? Consider using the ProGrids package for even finer control of your snapping and grid planes.
You can animate just about any property in Unity without writing a single line of code using the Animation window (Window > Animation > Animation). In addition to modifying movement, you can even drive parameters defined in your custom scripts.
You can create Animation Clips in this window or work in a third-party DCC package of your choice (Autodesk® Maya®, Blender, etc). Think of each clip as an individual unit of motion.
Edit the AnimationClip Asset within the window in either Dopesheet or Curve mode. Use K or C shortcuts, respectively, to toggle between the two. Use standard shortcuts to frame all keyframes (A) or frame selected keyframes (F).
Once you have several Animation Clips for your GameObject, the AnimatorController acts as a state machine to create a flowchart-like graph between them.
This allows you as an artist to produce sophisticated animation with greater independence from programmers. If you’re using a 2D or 3D rig, you can animate its body parts with different logic. Take advantage of the layering and masking features for greater control. Prototype your motions in a visual programming tool to fine-tune any transitions or interactions between your clips.
Extend this further using the Animation Rigging package. This package provides a library of rig and inverse kinematic constraints that can create procedural motion. Animated skeletons can thus interact with the environment with “runtime rigging,” or physics-based constraints can add dynamic secondary motion.
While AnimatorControllers offer convenience, be aware of a few caveats:
Refer to the manual pages about AnimationClips and AnimationController for more information about their usage. Read Unity’s evolving best practices for more about optimizing your animation components.
Gizmos are small overlay graphics associated with your GameObjects. Use them to navigate the viewport or locate specific objects.
Modify the icons for a GameObject using the Select Icon menu. Choose Other to define your own icon.
Use the drop-down in the Inspector to switch gizmos.
Select a custom gizmo using the Other… option.
You can also create gizmos with scripts and make them interactive. For example, a gizmo could help you define a volume or area of influence for a custom component.
In this example, a script changes the gizmo based on a selection.
Use the Gizmos dialogue in the Scene control bar to toggle specific gizmos or globally enable/disable all of them.
See Creating Custom Gizmos for Development for usage examples. Also, review the APIs for Gizmos and Handles.
Lightmapping allows you to precalculate both direct and indirect lighting, then store the result in a Texture called a lightmap for later use. Unity offers a number of Global Illumination (GI) techniques to produce high-quality lighting and shadows. Though lightmapped geometry is performant at runtime, baking a lightmap has historically been expensive.
The Progressive Lightmapper is a fast path tracer that produces a result quickly, then refines the render over time. You can thus interrupt the process to make changes without waiting for the final bake to complete, allowing you to iterate more rapidly.
Here are some tips to speed up your lightmapping:
The current Progressive CPU Lightmapper uses your machine’s CPU and RAM. The newer Progressive GPU Lightmapper (in Preview) uses your GPU and VRAM, potentially speeding up the bake considerably. If your computer meets the hardware and software requirements, this can dramatically accelerate up your lighting workflow (tenfold in some cases).
Global Illumination produces beautiful indirect lighting, but this can be expensive to calculate and store on disk. If you have set dressing or other static meshes that don’t absolutely require lightmapping, consider removing them from your lightmap bakes and use Light Probes instead.
In this example, Light Probes could approximate both direct and bounced lighting for the smaller objects, reserving the higher-quality lightmapping where it’s more noticeable. Lightmaps applied to the Viking Village project:
Formerly reserved for dynamic objects, Light Probes can apply to static meshes as well. In the MeshRenderer component, locate the Receive Global Illumination dropdown and toggle it from Lightmaps to Light Probes.
Light Probe illumination does not require proper UVs, saving you the extra step of unwrapping your meshes. The Spherical Harmonics basis functions used in probe lighting make it fast to calculate relative to lightmapping. Arrange Light Probes and Light Probe Groups spatially in the scene. Probe lighting typically bakes faster than lightmapping. A Light Probe Group with Light Probes spread across the level:
See Static Lighting with Light Probes for information about selectively lighting scene objects with Light Probes.
For more about lighting workflows in Unity, read Making believable visuals in Unity.
Want all the tips now? Download the guide, 70+ tips to increase productivity with Unity 2020 LTS for free. You will need to fill out a short form to have the e-book sent to your inbox. Enjoy these tips and hit the link above to get the rest! Also, use the comments section to let us know if these tips are useful, and what you’d like to cover next.