- Home /
Quarternion Rotation
I'm a noob, so please pardon my mistakes. What I'm trying to do is shoot out a laser from an object and make the laser's rotation (90,0,0).When I use Quaternion.identity it goes in the opposite direction to what I would like it to go. This is my script to shoot out the laser:
//Shoot out laser
Instantiate(Laser,position,Quaternion.identity);
Help would be much appreciated. :)
I changed your tags to something more useful. Don't tag stuff with "help please". Everyone is here for help. It's useless.
Answer by flaviusxvii · Sep 10, 2013 at 04:55 PM
Could you possible specify how I could use that command?
Instantiate(Laser,position,Quaternion.LookRotation(new Vector3(90f, 0f, 0f));
Or this one..
Instantiate(Laser,position,Quaternion.Euler(new Vector3(90f, 0f, 0f));
I like to use a source vector and a target vector.. so something like
Instantiate(Laser,position,Quaternion.LookRotation(target - source);
Wow, that works!:D Would you like me to credit you in my game? (if I release it)
Your answer
Follow this Question
Related Questions
How do you instantiate a prefab with a rotation based on the side of a cube you click on? 1 Answer
rotate an object on the z axis so that it does not exceed 0-45 degrees 0 Answers
Cannot instantiate rotation on Prefab 1 Answer
How to instantiate on custom rotation? 1 Answer
instant rotate an object 3 Answers