- Home /
How can we ball move and rotate simultaneously?
Hello Everyone, I am new on unity or i am making 1 ball related game but when i am using ball.rigidbody.addforce(...) by that the my ball is moving fine but its not rotating or i can't use transform.rotation because of dimentions....
so how can i do both the work at same time on finger swipe???
If anyone know the solution then please let me know thank you.
Dude, remove the "Code Sample" from your text "so how can i .... swipe???" by selecting the text and clicking on the button "101010".
Answer by moghes · Aug 23, 2013 at 06:24 AM
ball.rigidbody.Addforce() // to move your ball
ball.rigidbody.AddTorque() // to rotate your ball
Answer by Ian-McCleary · Aug 23, 2013 at 06:47 AM
The only thing i can think of is create an animation for your ball then apply that to your script with..
var Roll : String;
var Ball : Rigidbody;
function Start () {
if(Input.GetButtonDown(ball.rigidbody.addforce && gameObject.animation.Play(Roll));
}
Answer by VIPINSIRWANI · Aug 23, 2013 at 09:02 AM
Thank You for giving most valuable reply i got the solution Thank you...
@VIPINSIRWANI this post should be a comment, and you posted an answer ins$$anonymous$$d, think of other users as well.
Also the answer that answers you correctly, you have to tick it as true, so that it appeared as an answered question. Again will be helpfull for other who search.
Your answer
Follow this Question
Related Questions
Problem when applying forces to a ball 1 Answer
Stop a rotating plane using external force 1 Answer
How to rotate object about 2 axes (vertical y and depth z) using configurable joint. 0 Answers
AddForce not influenced by rotation 1 Answer
Returning a rigidbody back to its original x and z rotations through physics forces. 2 Answers