The big picture
For 3D games (and to some extent, 2D games as well), a fundamental class of object is the Vector3 class objects that store and manipulate (x, y, z) values representing locations in a 3D space. If we draw an imaginary arrow from the origin (0, 0, 0) to a point on the space, then the direction and length of this arrow (vector) can represent a velocity or force (that is, a certain amount of magnitude in a certain direction).
If we ignore all the character controller components, colliders, and the physics system in Unity, we can write code that teleports objects directly to a particular (x, y, z) location in our scene. Sometimes, this is just what we want to do; for example, we may wish to spawn an object at a location. However, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access