- Home /
Instantiate problem prefab wrong position in child object....
i have a crossbow...when i equiped it it become child of my character....and i use the mouse look to rotate around and all...so when i instantiate my arow prefab...it spawn it in random wrong position around the crossbow...some time higher some time lower....and some time very far from it....
so this is my script maybe it is or maybe it the fact that the object position is not clear...and yes i already check the instantia spawner....i checked every movement from the scene while playing
..
..
..
..
..
for(var p=0; p<10; p ++){Slider.Translate(Vector3.forward*-0.08);yield WaitForSeconds(Shots);}
for(var tp=0; tp<5; tp ++){Slider.Translate(Vector3.forward*0.08*3);yield WaitForSeconds(0.0001);}
var bullet = Instantiate(Arrow1,ASpot1.transform.position,ASpot1.transform.rotation);
bullet.rigidbody.AddRelativeForce(Arrow1.forward*Power);
for(var tt=0; tt<5; tt ++){Slider.Translate(Vector3.forward*-0.08);yield WaitForSeconds(Reload);}
and i tried by only using this in my couroutine and still doing the same things
..
..
..
var bullet = Instantiate(Arrow1,ASpot1.transform.position,ASpot1.transform.rotation);
...
...
...
and dont worry it is on mouse up...so not updating everytime...