Skip to main content

FAQ

Here is a list of frequently asked questions about TypeScript.

Limitations

Can TypeScript do all Unity APIs?

No, TypeScript can do most of Unity and C# APIs but there are some limitations and APIs that are not available.

Here are some notable APIs that cannot be used:

  • GameObject.SendMessage (Use custom events to send message between scripts)
  • MonoBehaviour.Invoke (Use Coroutines to perform delayed actions)

Known Bugs

Why are prefabs not working correctly?

Overrides to a prefab in the scene or a prefab variant will be overridden when making changes to the parent prefab.

Why is VS Code not working properly?

Some issues that could be experienced in VS Code are:

  • Autocomplete not working
  • Errors when trying to do vector operations
  • Not recognizing TypeScript syntax

Make sure you have the correct VS Code extensions installed.

This could also be caused by the TypeScript compiler not recognizing the most current version of TypeScript.

Here is a step by step to resetting VS Code to correct version:

  1. Close and reopen VS Code.
  2. Make sure the VS Code file parent directory is opened at the Unity project folder.
  3. At the top input field, type > TypeScript: Select TypeScript Version.
  4. Select the Workspace option from the dropdown menu.

VSCode Reset

Why does the console show a Puerts Bundle error?

This error has to do with a library package not being given access, usually seen on Macs.

Puerts Error

Here is a step by step to fixing this issue:

  1. Go into Mac Settings and open the Privacy & Security section.
  2. Then select Allow Anyways near the bottom.
  3. Go back into Unity and press the Play button.
  4. A dialogue popup will appear, select Allow package and then it works properly.

Puerts Settings

Why don't I see a bug in this list?

That might be a new bug not tracked yet! Please reach out in the Discord with more information.