UE4 C# Core APIs
Core API Reference
Classes
Name: string - The unique name of the GameObject.
Transform: Transform - The spatial information (location, rotation, scale) of the GameObject.
AddComponent<T>(): Adds a component of the specified type to this GameObject.
GetComponent<T>(): Retrieves the first component of the specified type, if any.
Owner: GameObject - The GameObject this component is attached to.
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
a: Vector3 - The first point.
b: Vector3 - The second point.
float - The distance between the two points.
float dist = Vector3.Distance(gameObject1.Transform.Location, gameObject2.Transform.Location);
a: Quaternion - The starting quaternion.
b: Quaternion - The ending quaternion.
t: float - The interpolation factor (0.0 to 1.0).
Quaternion - The interpolated quaternion.
Quaternion targetRotation = Quaternion.Slerp(startRotation, endRotation, Time.deltaTime * rotationSpeed);
Properties
transform.Translate(movementDirection * moveSpeed * Time.deltaTime);