- Home /
how to use itween with the object attached to other moving object
I have moving camera, and i attached other object to go with the camera,, so i need to temporary hide this objects,, i using 2d and it needs to go behind the background. I tried to disable render but it didn't work,, so i thouht it will work like this, when i use itween to move object GameObject goOther = GameObject.FindWithTag("cube6"); iTween.MoveTo (goOther, iTween.Hash ("position", new Vector3 (3.5f, 0.0f, -20), "time", 3.0f, "oncomplete", "setPosAndSpeed", "oncompletetarget", gameObject.tag = "cube6"));
but when that happend it flow all the way at the beggining and my moving camera left it. so i thought i could just move it by z, and the same thing happens GameObject goOther = GameObject.FindWithTag("cube6"); iTween.MoveTo (goOther, iTween.Hash ("z", -20 , "time", 3.0f, "oncomplete", "setPosAndSpeed", "oncompletetarget", gameObject.tag = "cube6"));
this is the code for rendered that i used but didn't work
goOther.renderer.enabled = false;
i'm using this with switch case, i have 6 of this cubes, and 6 different cases for this thank you all, hope you can help me