Hi guys, this might be a wide question or hard to answer without looking at it. but im making FPS game (which i had no idea what i was doing last week) but now its working gud. my gun its firing bullets (missiles) etc but there is suppose to be an explosion once it hits the ground… iv been following FPStutorial.
Here is the error msg:
MissingComponentException: There is no 'Collider' attached to the "Missile(Clone) game object, but a script is trying to access it.
You probably need to add a Collider to the game object "Missile(Close)". Or your script needs to check if the component is attached before using it.
If i double click on it, this is my code, which was working last time but the bullets were going backwards:
var projectile : Rigidbody;
var speed = 20;
function Update()
{
if( Input.GetButtonDown( "Fire1" ) )
{
var instantiatedProjectile : Rigidbody = Instantiate(
projectile, transform.position, transform.rotation );
instantiatedProjectile.velocity =
transform.TransformDirection( Vector3( 0, 0, speed ) );
Physics.IgnoreCollision( instantiatedProjectile. collider,
transform.root.collider );
}
}