Key Differences - T# versus C#
This page lists everything that is currently not supported in T#
Last updated
This page lists everything that is currently not supported in T#
Last updated
While T# is designed to feel instantly familiar to Unity C# developers, there are a few important differences to keep in mind. These tweaks exist to support the interpreted nature of T# and ensure smoother live editing inside Terra Studio.
Most of your Unity habits will carry over just fine โ but for the few edge cases, here's what you need to adjust:
T# follows Unity C# syntax closely, but some common programming patterns and language constructs are not supported due to the interpreted runtime.
โ
Supported: Start()
, Update()
, typed variables
โ Not Supported: foreach
, switch
, enum
, inline variable assignment, SerializeField
, generics (GetComponent<T>()
), etc.
โก๏ธ See Full Syntax Differences in the link below โ
T# uses a different base class for networked behavior.
Unity's NetworkBehaviour
is replaced by TerraNetBehaviour
in T#, and includes its own override methods like OnNetworkSpawn()
and OnNetworkDespawn()
for multiplayer object lifecycle management.
โก๏ธ See Multiplayer Differences documentation hereโ
Certain Unity MonoBehaviour APIs are not available in T#, especially those involving advanced lifecycle hooks or reflection.
โ Not Supported: LateUpdate()
, Invoke()
, TryGetComponent()
, GetComponent<T>()
, OnCollisionEnter
as coroutine, Start()
as coroutine, and more.
โ๏ธ Workaround: Use coroutines manually (StartCoroutine()
) and simulate delayed behavior with WaitForSeconds()
or WaitForEndOfFrame()
.
โก๏ธ See Unity API Restrictions here โ
T# does not support C# generics-based collections like List<T>
, Dictionary<TKey, TValue>
, or LINQ queries.
Instead, use Terra-compatible containers:
โ
TerraList
โ
TerraDictionary
โ Avoid: storing custom scripts or structs in collections
โก๏ธ See Collections & Types restrictions hereโ
Unity-specific interfaces like IPointerClickHandler
, Action
with more than 4 parameters, and try-catch blocks are unsupported in T#.
Manual input handling and structured coroutines are your go-to alternatives. Also:
โ Vector3
boxing
โ partial
classes
โ
PlayerPrefs
is fully supported (and integrated with Analytics)
โก๏ธ See Input, UI & Misc Limitations โ