- Home /
Wront rotation of spawning bullet
So, my bullet is always spawning in this rotation:
My spawning script look like:
a = Instantiate(bullet, miejsce, Quaternion.identity) as GameObject;
Changing third argument is seting bullet's way, not rotation of model(object). Way of bullet is working good, just got problem with model's rotation. How to fix it?
Answer by KMKxJOEY1 · Jun 24, 2013 at 01:23 AM
adjust the rotation in the model file :)
99.9% of the time, this is the problem. $$anonymous$$odelling programs use different axis to Unity. Find what the forward axis for Unity is in your modelling program ( eg : Blender -ve Y is the Unity +ve Z ). Upvoted.
that's not working. changing rotation of model will change bullet rotation but always it will be that rotation.
how about attaching a script to the bullet to rotate it towards where it is going
Answer by Mohamad Farid · Jun 24, 2013 at 06:28 AM
Try this code :
shot = Instantiate(bullet, gameObject.Find("spawnPoint").transform.position, Quaternion.identity;
shot.rigidBody.AddForce(transform.foward * 1000);
If this doesnt works go to blender or whatever modeling program and rotate the bullet foward and test.
Hope this helps :D
Your answer
Follow this Question
Related Questions
need help with roation 2 Answers
How to make my new Instances spawn in the right direction? 1 Answer
Player Instantiate rotaion problem 0 Answers
How to force a variable to prefab 1 Answer
Enemy not spawning correctly 1 Answer