Moving Objects in Unity: Unterschied zwischen den Versionen

Aus hyperdramatik
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
'''Unity : How to move an object in 3D space?'''
'''Unity : How to move an object in 3D space?'''


There are different ways to move an object within 3D space.  
There are different ways to move an object within 3D space with code. Here we go over 5 options.


'''A) transform.position'''
'''A) transform.position'''


'''transform:''' Position, rotation and scale of an object.   
'''Transform:''' a Class which contains the information of position, rotation and scale of an object.   


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


'''
'''Vector:''' A mathematical entity commonly drewn as an arrow in two or three dimensional space, which has a a magnitude (size or length) and a direction (angle θ). A class
'''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.
 
'''
'''A Vector3(float x, float y, float z) is a Unity C# struct representing points and vectors in 3D space.

Version vom 23. Oktober 2019, 14:07 Uhr

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

There are different ways to move an object within 3D space with code. Here we go over 5 options.

A) transform.position

Transform: a Class which contains the information of position, rotation and scale of an object.

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

Vector: A mathematical entity commonly drewn as an arrow in two or three dimensional space, which has a a magnitude (size or length) and a direction (angle θ). A class

A Vector3(float x, float y, float z) is a Unity C# struct representing points and vectors in 3D space.