- Home /
How to give Power to Cue Ball in Snooker after stick having collision action on it?
In the game of Snooker, when Cue Ball is not moving, I've made the Snooker Stick to rotate around the Cue Ball to find the hit point over the Cue Ball.
Then, on 'getMouseButtonDown' event, I've given the 'rigidbody.AddRelativeForce' to the Stick, which allow it to collide with the Cue Ball along 'Z-Axis'. This will make Cue Ball to move, but at very lower speed because force was applied to stick and it transfers the force on Cue Ball on collision.
If I increase the power value, i.e., around 40000, then Cue Ball moves very fast that it almost skits when it was hit, then after some distance, it starts rolling.
I really don't know where I'm making the mistake, but I'm quite sure that if Force is directly applied to the Cue Ball, then all will be fine.
But if I'm going to apply force to the Cue Ball, how will I'm being able to find the desire angle, in which I want to play shoot on the board because when force is applied to the 'Sphere' game object along a particular axis, it will rotate and when this object's 'velocity is equals to Vector3.zero'.
So, how we will frame out the next shoot, where we have to find:
What is the rotation axis values (x,y,z) of the Cue Ball?
How to find the position of Cue Ball to move Snooker Stick to that position where Cue Ball Stop when force is applied to the Ball?
Thanks for your Attention. Looking for some helpful response.
Answer by robertbu · Feb 05, 2013 at 06:50 AM
Your force issues may be related to the mass and size settings you have for the stick and balls. Start with by "modeling" the object at real size/mass and see what happens. As for applying force to the ball once it has been played, take a look at Rigidbody.AddForceAtPosition(). This will allow you to use the angle and placement of the stick to hit the ball without having to calculate any axis.
You may also have to play games with freezing or damping force in certain directions.
Answer by anamzara · Nov 16, 2016 at 07:42 PM
Then, on 'getMouseButtonDown' event, I've given the 'rigidbody.AddRelativeForce' to the Stick, which allow it to collide with the Cue Ball along 'Z-Axis'. This will make Cue Ball to move, but at very lower speed because force was applied to stick and it transfers the force on Cue Ball on collision. Mahjong