Moving Objects in Unity

Aus hyperdramatik
Zur Navigation springen Zur Suche springen

Unity : How to move an object in 3D space?

There are different ways to move an object within 3D space.

A) transform.position

transform: Position, rotation and scale of an object.

transform.position: The position property of a GameObject's Transform. Gives the object a new position.

Vector: A class to describe a two or three dimensional vector, a vector is an entity that has both magnitude and direction. A Vector3(float x, float y, float z) is a Unity C# struct representing points and vectors in 3D space.