I have a parent who turns all the time, and I can shove objects into him, but only one, i.e. deleted added, deleted, added, the essence is clear, but I need to add a new one the same as in the remote, which I just didn’t do with the turns and what doesn’t work, here’s the object code:

GameObject _go = Instantiate(Objects[number], ParentTransform); _go.transform.localEulerAngles = Vector3.zero; 

doesn't work, how can it be different?

Update: I need that when adding an object in a child ie _child.SetParent (_Parent) , the child had a rotation of 0 relative to the parent i.e. that he was turned the same way as the parent turned

    1 answer 1

    If you want a zero turn in relation to the world:

    1. add an object without a parent object. Just to the world.
    2. transform.rotation = new Quaterion (0,0,0,0); // rotation is zero
    3. add as child
    4. trasform.position = new Vector3(0,0,0); // set the object to zero

    If you want a child's zero turn relative to the parent:

    1. Add child object
    2. trasform.position = new Vector3(0,0,0); // set the object to zero
    3. transform.rotation = new Quaterion(0,0,0,0); // rotation is zero
    • Everything would be fine, but the quaternion is constructed from 4 floats, correct, be kind. - RiotBr3aker
    • the same effect as with the simple new Vector3 (0,0,0); - k0vpack
    • @ k0vpack works for me. Are you sure that you add as a child? Track where your object is after adding objects on stage through the inspector. - Andrew
    • @Andrew I add it with a code, and at the moment I specify the parent immediately, but for some reason the object's turn is equal to the parent's turn - k0vpack
    • it should be. Proddetil answer. If the answer does not reflect what you wanted to see, update your question so that it becomes clear quite clearly what you want to receive. If necessary - with screenshots. - Andrew