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 withWaitForSeconds()
orWaitForEndOfFrame()
.
โก๏ธ 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, AsyncLast updated