Hi,
I think i don’t really get the transform position mechanisms :
On my scene I got a hierarchy like this:
player/shieldPos
with shieldPos as an empty game object that i’d like to use as a position for my shield to load
Now I’d like to instantiate a shield at this very same shieldPos place:
So in my player class i got
publicvoidloadShield(strings){
GameObjectcloned= Instantiate(Resources.Load(s),newVector3(0,0,0), Quaternion.identity)asGameObject;
cloned.transform.parent = this.gameObject.transform.Find ("shieldPos");
cloned.name = "shield";
}
now I got a shield object as a child of ShieldPos (as I wanted), but not a the 0,0 pos as I wanted
the player is at pos(-1.97,0.697)
the ShieldPos is at pos(0.56,-.06) (of the player)
and my new instantiate shield is at (-2.53,0.637) of the shield pos, instead of (0,0) ?
So i see that i does a difference between the playerpos and the shieldPos, but how can i tell it to just stay at 0,0 ?