- Home /
How to define directions of a spawned object?
I recently posted a code about spawning object on Input, I often use this:
var Nospherebullet:Transform; var Bulletforce: int;
if(Input.GetButtonDown("Fire1") { var Nospherebullet = Instantiate(Nospherebullet, GameObject.Find("Spawn").transform.position, Quaternion.identity);
Nospherebullet.rigidbody.Addforce (transform.forward * Bulletforce); } }
But the spawned object always goes in one direction, wherever the player looks at.
Which is the code to define certain directions? (forward, up/down etc)
Please edit your question and format your code. Select the code and use the 101/010 button.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Need to know euler angles of Vector3 direction relative to other Vector3 direction 1 Answer
How can i randomly create an array of objects without colliding one another? 1 Answer
Rotating a direction Vector3 by Quaternion 2 Answers
Android: Get Direction from touch 0 Answers