|
I want a ball to fly up when it hits a plane in javascript. The action would be similar to the ball rolling over a burst of air, where the force is upwardly...
(comments are locked)
|
|
Create yourself a cube that is not rendered and flagged as a trigger only. Place this cube where you want the ball to be "affected" by the air jet. In your ball gameObject, attach a script which has code similar to the following: What this code says is that when the ball enters a trigger area, an instantaneous impulse force will be applied in the "up" (Y Axis) direction. I tried this out and it worked like a champ. thank you! worked like a champ for me as well...
Apr 10 '12 at 10:50 PM
valichm
how can I make it so that this object can still be destroyed when the ball collides with it? in other words, is there a way to add a script like this to an object and not a trigger?
Apr 11 '12 at 07:33 PM
valichm
(comments are locked)
|
