Cogito, ergo sum
- Direct subclasses:
- Commandlet, Actor
- This class in other games:
- RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT2004, UDK, UT3
Note the distinction between the Object class itself and an object as an instance of a class in general. Another distinction often made is between "actors" as instances of Actor subclasses and "non-actor objects" as instances of classes that do not extend Actor. Actors are created either by a mapper placing them in the level or at runtime with the Actor.Spawn() function. Non-actor objects on the other hand can be created in various ways in the editor, such as creating or importing resources or creating new object values in an actor properties window. At runtime, new instances for non-actor classes can be created with the new operator.
The Object class defines only few basic properties, all of which are defined when the object is created and cannot be changed later at runtime. (const) In the editor renaming or moving resources is possible only via a special editor feature, not by directly editing the object properties. (editconst)
Property group 'Object'
The name of this object.
The class of this object.
The enums defined in the Object class differ greatly between the various engine generations. Some examples include ESheerAxis(RTNP, U1, UT, U2, U2XMP, UE2Runtime, UT2003, UT2004), EAxis(U2, UE2Runtime, UT2004, UDK, UT3), EDrawPivot(UT2003, UT2004) and ETickingGroup(UDK, UT3).
Some commonly used types that seem to be built-in types, such as vector or rotator, are actually structs defined in the Object class so they are available everywhere. Some commonly available structs are described below.
- Main article: Color
An RGB color with alpha (opacity) value.
- byte B
- Blue color component.
- byte G
- Green color component.
- byte R
- Red color component.
- byte A
- Alpha value.
A coordinate system. Usually the X, Y and Z axes are perpendicular to each other so that in the coordinate system X faces forward, Y faces right and Z faces up.
- Vector Origin
- The origin of this coordinate system in global coordinates.
- Vector XAxis
- The coordinate system's X axis.
- Vector YAxis
- The coordinate system's Y axis.
- Vector ZAxis
- The coordinate system's Z axis.
Describes a plane using X/Y/Z as normal vector and W as distance from origin or a sphere using X/Y/Z as center location and W as radius.
Note that components are rounded for replication, so Plane values actually describing a plane may need their X/Y/Z values multiplied by a larger value prior to replication, similar to vectors.
- float W
- Main article: Quaternion
Quat values are assumed to represent unit quaternions (
Sqrt(X*X + Y*Y + Z*Z + W*W) == 1.0) for replication, so the W value is not replicated, but reconstructed from X, Y and Z.
- float X
- The i component of the quaternion.
- float Y
- The j component of the quaternion.
- float Z
- The k component of the quaternion.
- float W
- The real component of the quaternion.
- Main article: Rotator
A 3D rotation value. Components are applied in the order Yaw, Pitch, Roll.
For replication, component values are compressed by bitwise AND (
component & 0xFF00), so you can only really replicate an orientation, not a rotation rate. For more precision or to retain the sign or values above 0xFF00 you could, for example, map the components to the X, Y and Z values of a vector and replicate that instead.
- int Pitch
- The pitch component. (think nodding for "yes")
- int Yaw
- The yaw component. (think shaking the head for "no")
- int Roll
- The roll component. (think tilting your head left and right for "not sure")
- Main article: Vector
A 3D vector value. Vector components are rounded for replication.
- float X
- The vector's X component.
- float Y
- The vector's Y component.
- float Z
- The vector's Z component.
- Main article: Operators
The Object class defines most of the operators you can use in UnrealScript code. Only a few special operators, such as the assignment operator
=, the conditional operator
? : or the (in)equality comparison operators
!= for structs in general are implicitly available because they cannot be expressed in a standard operator declaration. All others actually have a declaration in UnrealScript, usually in the Object class so they are globally available.
The object class also defines many functions so they are globally available.
|This short section needs to be expanded.|