Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Unity 5  Game Optimization

You're reading from   Unity 5 Game Optimization Master performance optimization for Unity3D applications with tips and techniques that cover every aspect of the Unity3D Engine

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher Packt
ISBN-13 9781785884580
Length 296 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Dickinson Dickinson
Author Profile Icon Dickinson
Dickinson
Arrow right icon
View More author details
Toc

Consider caching Transform changes


The Transform Component only stores data relative to its own parent. This means that accessing and modifying a Transform Component's position, rotation, and scale properties can result in a lot of unanticipated matrix multiplication calculations to generate the correct Transform representation for the object through its parents' Transforms. The deeper the object is in the Hierarchy, the more calculations are needed to determine the final result. To make matters worse, changes to a Transform Component also send internal notifications to colliders, rigid bodies, lights, and cameras, which must be processed.

However, this also means that using localPosition, localRotation, and localScale have a relatively trivial cost associated with them, because the values can be retrieved and written as they are passed in. Therefore, these local property values should be used whenever possible. However, changing our mathematical calculations from world space to local space...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images