- Home /
Question by
Owen Burk · Mar 10, 2014 at 08:19 PM ·
transform.parent
Why is the object not parenting?
The object goes to the center of the scene and kinds tweaks when I move.
#pragma strict
var theAxe : Transform;
var theAxeGO : GameObject;
var theAxeBabyGO : GameObject;
var theWeapons : GameObject;
var Player : Transform;
function Update ()
{
if(WaveStart.waveNumber > 1)
{
theAxeBabyGO.SetActiveRecursively(true);
theAxe.parent = theWeapons.transform;
Debug.Log("Transform");
theAxeGO.transform.position = Vector3(-0.05852705, 1.377277, 0.3571841);
theAxeGO.transform.rotation = Quaternion.Euler(0, 0, 0);
//theAxeGO.SetActiveRecursively(true);
}
else
{
theAxe.parent = Player;
theAxeGO.SetActiveRecursively(false);
}
}
Comment
probably because something else is parenting it somewhere else, ... don't know, ...
it could be you are parenting it to your player, ...
I realize that it might be because it is updating. I will have the script that deter$$anonymous$$es the wave send a message to call a function so it isn't updating and see if that works.
yeah, I was going to ask you why you were handling it on the Update. I think it should be a better way to handle it outside update!