Search Unity

Other values in transform

Discussion in 'Scripting' started by Corchado, May 13, 2021.

  1. Corchado

    Corchado

    Joined:
    May 31, 2018
    Posts:
    9
    Hi, i have this code:


    GameObject ringSelec = Instantiate(ring, new Vector3(2, 2, 2, Quaternion.Euler(90, 0, 0));

    The problem is that i run this value change for other values, why?

    regards
     
    Last edited: May 13, 2021
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    This is very minimalistic. I have no idea what you are even asking. But a good starting point would be to pay attention to your brackets. You are passing the rotation as a fourth parameter into the Vector3 constructor, which only expects 3 values.
     
    Joe-Censored and StarManta like this.
  3. Corchado

    Corchado

    Joined:
    May 31, 2018
    Posts:
    9
    I solve it
    The position indicated in the Instantiate the interpretation as global position, and you are passing the local position to it.

    thanks