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
  4. Dismiss Notice

How do i change the position of an object at the start of the scene

Discussion in 'Getting Started' started by SmosesOG, Sep 18, 2020.

  1. SmosesOG

    SmosesOG

    Joined:
    Sep 18, 2020
    Posts:
    2
    Hello everyone,

    I just started learning c# and i try to learn how unity works. I created an object, and i want it to change to position 0,0,0 when i press play scene. I wrote the code "transform.position = new Vector3(0, 0, 0);" but when i press play in unity, the position values stay the same.
    Can anyone help me ?
    Thanks!
     
  2. SmosesOG

    SmosesOG

    Joined:
    Sep 18, 2020
    Posts:
    2
    Damn, didn't know i had to drag the script to the object for it to work. Just found out!
     
    Joe-Censored likes this.