Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What syntax is this?

Discussion in 'Scripting' started by guitarxe, Apr 10, 2014.

  1. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Following along with this tutorial, I come upon this syntax in the code:

    Code (csharp):
    1. Transform o = (Transform)Instantiate(prefab);
    The Instantiate(prefab) part is perfectly clear. What I don't understand is what the (Transform) before it is supposed to mean.
    Is it a cast to Transform?
     
  2. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    Yes.