Key Differences - T# versus C#

This page lists everything that is currently not supported in T#

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:

๐Ÿงพ 1. Syntax Differences

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 โ†’

Syntax Differences - T# v/s C#

๐ŸŒ 2. Multiplayer Scripting

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โ†’

Multiplayer Support Differences


๐Ÿ”Œ 3. Unity API Restrictions

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 โ†’

Restrictions on Unity APIs


๐Ÿงฑ 4. Restrictions on Collections & Types

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โ†’

Restrictions on Collections & Types


๐ŸŽฎ 5. Input, UI & Miscellaneous Restrictions

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 โ†’

Restrictions on Input, UI, Async

Last updated