Search Unity

Converting line of code from JS to c#

Discussion in 'Scripting' started by RandomCharacters, Jun 18, 2018.

  1. RandomCharacters

    RandomCharacters

    Joined:
    Nov 29, 2012
    Posts:
    262
    .
     
    Last edited: Jan 15, 2019
  2. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    Yes, a new Vector3 :
    Code (CSharp):
    1. transform.localScale = transform.localScale + new Vector3(4, 4, 4);
     
    Ryiah and johne5 like this.
  3. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    It will be a good opportunity to pick up familiarity with C# as you go along, which is no bad thing. Best of luck with it. :)
     
    Ryiah likes this.
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    There's an official converter that might smooth the process, here.

    Note that it's not perfect, and to understand how to fix the errors that are left after it's run, you kind need to know how C# works, so it might be better for you to do this manually.
     
    Ryiah likes this.