- Home /
Explosion problem
Hello,
I have a mine in my game. If the marble rolls over it, then it should create an explosion force, which sends the marble to the opposite direction where it came from. However, the explosion send the marble directly up every time.
How should I fix it?
Here is the script:
var radius = 5.0;
var power = 250.0;
var explosionPos : Vector3;
function Start ()
{
explosionPos = transform.position;
}
function OnTriggerEnter (other : Collider)
{
if (other.tag == "Player")
{
other.rigidbody.AddExplosionForce(power, explosionPos, radius, 3.0);
}
}
Thanks!
Would it help to put the explosionpos slightly above the $$anonymous$$e itself?
Answer by FTheCloud · Aug 09, 2011 at 01:28 PM
Use the explosion framework provided by unity 3d:
http://unity3d.com/support/resources/unity-extensions/explosion-framework.html
I have tried it, and I my marble still goes up, not backward. I have noticed, that it spins the marble, and shoots it up.
Your answer
Follow this Question
Related Questions
How to make helicopter fall and explosion 1 Answer
Instantiated Bomb Not Exploding 1 Answer
AddExplosionForce won't have any effect. 1 Answer
AddExplosionForce() does not appear to have any effect 1 Answer
Directional Explosion 1 Answer