- Home /
Force applied to a Sphere from a paddle(Cube,Rectangle)
Hi i'm totaly new to this, but i messing around with the physics which are really good. Here's what happens so far when you click the left mouse a sphere is generated and thrown,shot in a forawrd direction. I have place Rectangles (Paddles) made from cubes which rotate using the built in animation features. what i want to happen is when a sphere is trown towards a paddle it should flick it in the direction the paddle is facing. It somewhat does this automatically but not with much power. I havn't set the paddles as rigidbody as they are floating in the air because when i set rigidbody the paddles fall when hit with a sphere. Any help would be appreciated. Thanks.
Answer by Tonycrew · Jul 24, 2010 at 01:39 PM
I've tried this bit it doesn't work.
var forceAmount = 9.0;
private var hasCollided : boolean = false;
function OnCollisionEnter (collision : Collision)
{
if sphere(hasCollided);
sphere.AddRelativeForce (0, 0, 10);
// spherePrefab.rigidbody.AddForce( transform.forward * forceAmount );
// sphere.rigidbody.AddForce( transform.forward * forceAmount );
}