4.6UI Rect Transfrom fix

I use the 4.6 new UI, as will a weapon panel made into prefabricated object, when I instance it will be his father object is assigned to the canvas, and then problems came out, he coordinates all messed up, how should I modify the weapons panel coordinates, my English is not very good

This won’t be the exact code you need, as I don’t entirely know how you’re instantiating it.

using UnityEngine;
using System.Collections;

public class Parent : MonoBehaviour 
{
    // This is set in the Inspector
    public GameObject childPrefab;
    GameObject child;

	// Use this for initialization
	void Start () 
    {
        Debug.Log(transform.position);
        // Instantiates the child at it's position.
        // Note the child I instantiated was anchored to the bottom left corner.
        child = Instantiate(childPrefab, childPrefab.transform.position, Quaternion.identity) as GameObject;

        // Makes the child's parent this scripts GameObject.
        child.transform.parent = transform;
	}
}

Sorry, I really should have checked the code before I posted it. It should be fixed now. But in order for it to position correctly when the screen size is different, you’re going to need to make it anchored to the correct corner.