Restrictions on Unity APIs
This page lists everything that is currently not supported in T#
While T# supports many of Unityβs APIs, certain methods, lifecycle hooks, and behaviors are restricted. These limitations exist due to the live-editing runtime and interpreted execution model of Terra Studio
π« LateUpdate
In Unity, LateUpdate()
is often used to perform actions after all Update()
calls β such as camera movement or following a character.LateUpdate()
is not supported in T#.
π What you instead need to do in T#:
Use coroutines with WaitForEndOfFrame()
to simulate end-of-frame logic.
Call the coroutine when needed, for example in Start()
or Update()
:
π§ͺ GetComponent after Instantiate
In Unity, itβs common to Instantiate
a prefab and immediately call GetComponent<T>()
to modify or configure a component. This pattern is popular for initializing scripts or physics behaviors right after spawning an object. In T#, this only works under a specific condition.
π What you instead need to do in T# to get a component after Instantiate:
Use the non-generic version of GetComponent
with typeof
and an explicit cast.
Even when using the non-generic GetComponent, make sure βAwake Initβ is enabled if calling it immediately after Instantiate().
β³ Coroutines in Start
Start
In Unity, you can define Start()
as a coroutine (IEnumerator
) to handle initialization steps with delays or wait conditions. This pattern is not supported in T#.
π What you instead need to do in T# to use coroutines at startup:
Use a regular void Start()
method and trigger a coroutine from there.
β‘ Unity Events as Coroutines
In Unity, developers sometimes write event callbacks (like OnCollisionEnter
) as coroutines to introduce delays directly within the event flow. This technique is not supported in T#.
π What you instead need to do in T# to delay event-based logic: Instead, use a normal event method and start a coroutine from it.
β²οΈ Invoke Methods
Unity provides Invoke()
and InvokeRepeating()
to call methods after a delay or repeatedly without needing coroutines. These are not supported in T#.
π What you instead need to do in T#: Use coroutines to delay method calls.
Last updated