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 mine itself?
– Sir_KeyzinburgaNo, I have tried it.
– Dreeka