0

Can anyone help me convert this Unityscript code to C# in Unity3d. I am having trouble understanding variable text and transform (i.e var text: Transform;)

#pragma strict


var text: Transform;
1
  • 1
    it's unityscript, not javascript Commented Jan 25, 2015 at 8:36

1 Answer 1

4

Based on the code you've posted thus far, the C# equivalent would be:

Transform text;

Transform is the type. text is the name of the variable being declared.

Unity actually provides a beginner video that explains the syntax differences between JS and C#:

Unity - C# vs JS syntax

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.