- Home /
Collision with terrain
I have a script where it detects collision and then causes an explosion. For some reason the collision isnt detected until the object is in the center of the collider(terrain). The explosion doesnt start as soon as the bullet hits the edge of the hill, its starts when the bullet is in the middle of the hill.
var hit : RaycastHit;
if (Physics.Raycast(transform.position, -Vector3.up, hit, 1))
{
Instantiate(hitObject, hit.point, Quaternion.identity);
}
Anyone know why its doing this? The explosion also occurs several times due to the fact that it expands in radius and therefore keeps hitting the terrain until its smaller.
Comment
Your answer
Follow this Question
Related Questions
triggering prefabs upon collision 1 Answer
Objects do not destroy on Collision 1 Answer
How to destroy bullet on collision! 2 Answers
Destroy Projectile on collision 3 Answers
Destroy Turret with machine Gun 0 Answers