- Home /
Bow and Arrow functionality in Unity3d
Hello ,
I am making a bow and arrow kind of game , similar to http://www.youtube.com/watch?v=cpLlvka6mag&feature=player_detailpage
I have made this https://dl.dropboxusercontent.com/u/70903877/ArrowGame/ArrowGame/ArrowGame.html Here press and leave mouse to shoot arrows. press space to recreate the arrows.
I want mainly to focus on the projectile motion of the arrow and also the option to set the angle direction for the arrow,when I hold and drag the mouse up and down.
I have tried writing this : if(Input.mouseUp(0)) { rigidbody.AddRelativeForce(Vector3(1.0f,0.5f,0.0f)*5000f); // and also rigidbody.AddForce(Vector3(1.0f,0.5f,0.0f)*5000f); }
But none of them worked. Please give me some kind of ideas. Thanks in advance.
I'm not able to test the webPlayer on my device so I'm not sure how it's working right now, but wouldn't it be a matter of using a rigidBody, adjusting its rotation depending on the mouse position and also adjusting the force depending on how far (considering the $$anonymous$$/max) the mouse cursor is from the bow/arrow?
Your answer
Follow this Question
Related Questions
Add Force to the right of the rigidbody, not right of the screen 1 Answer
Rigidbody movement issues 1 Answer
Adding a force to an object relative to a rotation? 0 Answers
A sphere moved by relativeforce is acting wierd? 2 Answers
AddForce and AddRelativeForce not forcing in the right directions 2 Answers