Unity API
Scripts can use a broad, filtered part of the Unity API. The API Reference lists every allowed member, generated from the same list the compiler uses.
| Area | What you can use |
|---|---|
| Objects | GameObject (SetActive, activeSelf, name, tag, GetComponent<T>() family), Transform (position, rotation, scale, local values, directions, Rotate, Translate, LookAt, point/direction conversions, children, SetParent inside your world), Component, Behaviour.enabled |
| Maths and time | Mathf, Random, Vector2/3/4, Quaternion, Color, Time |
| Physics | Rigidbody (velocity, forces, kinematic, gravity), Collider (enabled, isTrigger) |
| Look and sound | Renderer, Material (colours, floats, vectors), Light, AudioSource / AudioClip, Animator parameters, ParticleSystem |
| UI | TMP_Text, UI Text, Image, RawImage, Slider, Toggle, Selectable.interactable |
| Text | common string methods; ToString and Parse for int, float, double, bool |
| Logging | Debug.Log, Debug.LogWarning, Debug.LogError |
Not available
Files, web requests, GameObject.Find, scene loading, PlayerPrefs, cameras, Instantiate / Destroy and anything
that reaches outside your world. Using them is a compile error that names the member.
Staying inside your world
transform.rootis your world's root, andSetParentonly accepts parents inside your world.GetComponentand friends only see objects in your world.- Material changes affect your world's materials only.