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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Translate

Discussion in 'Scripting' started by fonix, Apr 13, 2015.

  1. fonix

    fonix

    Joined:
    Mar 30, 2015
    Posts:
    2
    Hi there, could anyone be so kind and help me to translate this JS ind C# ?

    Code (JavaScript):
    1. transform.localScale.x+=Input.GetAxis("Mouse ScrollWheel")* Time.deltaTime*20;
    2. transform.localScale.y=transform.localScale.z=transform.localScale.x;
    I tried ... and failed :confused:
     
  2. proandrius

    proandrius

    Unity Technologies

    Joined:
    Dec 4, 2012
    Posts:
    544
    Hi
    Code (csharp):
    1. transform.localScale = new Vector3(transform.localScale.x+Input.GetAxis("Mouse ScrollWheel")*Time.deltaTime*20,transform.localScale.x,transform.localScale.x);
     
  3. fonix

    fonix

    Joined:
    Mar 30, 2015
    Posts:
    2
    Yes! muchas gracias! that works