I click once to instantiate A, then I click again so that B is instantiated in the same place where I have begotten A. I tried this code but it did not work.
if (AmountA > 0 && StateMouse == 0)
{
Instantiate(PrefabA, LocalItem.position, LocalItem.rotation); //Ok, He left the correct place, and is on the scene.
AmountA--;
}
StateMouse++;
if (StateMouse == 2)// new click, instance B
{
StateMouse = 0;
Rigidbody ne = GameObject.Instantiate(PrefabB, PrefabA.transform.position, PrefabA.transform.rotation) as Rigidbody; //<<<Wrong place
GameObject.Destroy(PrefabA); // Destroy A
}