Core APIs

Core API Reference

Classes

GameObject
class GameObject
Represents an object within the game world that can have components and transform. It's the fundamental entity in the Unreal Engine.
Fields:

Name: string - The unique name of the GameObject.

Transform: Transform - The spatial information (location, rotation, scale) of the GameObject.

Methods:

AddComponent<T>(): Adds a component of the specified type to this GameObject.

GetComponent<T>(): Retrieves the first component of the specified type, if any.

Component
abstract class Component
The base class for all components that can be attached to a GameObject. Components define functionality and behavior.
Fields:

Owner: GameObject - The GameObject this component is attached to.

Transform
struct Transform
Represents the spatial properties of a GameObject: position, rotation, and scale.
Properties:

Location: Vector3 - The world-space position of the transform.

Rotation: Quaternion - The world-space rotation of the transform.

Scale: Vector3 - The world-space scale of the transform.

Methods

Vector3.Distance
static float Distance(Vector3 a, Vector3 b)
Calculates the Euclidean distance between two points in 3D space.
Parameters:

a: Vector3 - The first point.

b: Vector3 - The second point.

Returns:

float - The distance between the two points.

float dist = Vector3.Distance(gameObject1.Transform.Location, gameObject2.Transform.Location);
Quaternion.Slerp
static Quaternion Slerp(Quaternion a, Quaternion b, float t)
Performs spherical linear interpolation between two quaternions. Useful for smooth rotational transitions.
Parameters:

a: Quaternion - The starting quaternion.

b: Quaternion - The ending quaternion.

t: float - The interpolation factor (0.0 to 1.0).

Returns:

Quaternion - The interpolated quaternion.

Quaternion targetRotation = Quaternion.Slerp(startRotation, endRotation, Time.deltaTime * rotationSpeed);

Properties

Time.deltaTime
static float deltaTime
The time in seconds it took to complete the last frame. Useful for frame-rate independent movement and logic.
transform.Translate(movementDirection * moveSpeed * Time.deltaTime);