( (GameObject)Instantiate (currentMainWeaponMesh, Ship.position, Quaternion.identity)).transform.parent=this.transform;
currentMainWeaponMesh is a public gameobject of course… why it is not rotating with parent?.. o.o
( (GameObject)Instantiate (currentMainWeaponMesh, Ship.position, Quaternion.identity)).transform.parent=this.transform;
currentMainWeaponMesh is a public gameobject of course… why it is not rotating with parent?.. o.o
have you tried setting the rotation after it’s created?
howcome?
Is it actually parented in the hierarchy? If it is, they’ll rotate together.
no they aren’t they are parented via script dinamically
I understand. I meant if they are parented in the hierarchy after your code is executed.
yeah, and they don’t rotate o.o
Try doing it with 2 lines of code.
You are trying to parant it to itself with the code in the first post.
No he’s not - he’s parenting the instantiated object to the object executing the instantiation code.
If you rotate the parent via the Inspector do they rotate as you intend? If so then something in your code is wrong.
Sorry, my bad.
Is the script executed from the object you want to be the parent then?
set rotation after that
make a script to rotate lik its parent
i solved this by changing the hierarchy of the objects, now i have annother question, but it is off thread i will make annother thread for that
i never get what u telling? Can u tell the questions n the clear manner?