What is the problem with my script and how to fix it??

I am new to coding and unity,I got this script from tutorials.Unity3d says

There are inconsistent line endings in the ‘Assets/MissileLauncher.js’ script. Some are Mac OS X (UNIX) and some are Windows.

This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

var Projectile : Rigidbody;
var speed = 20;


function Update () 
{


if( Input.GetButtonDown( "Fire1" ) )
  
{
	var instantiatedProjectile : Rigidbody = Instantiate( projectile, transform.postion, transform.rotation )

instantiatedProjectile.velocity =transform.TransformDirection( Vector3( 0, 0, speed ) )

	Physics.IgnoreCollision( instantiatedProjectile. collider,transform.root.collider )
}




}

Your problem is quite simple. But it’s the simple things that get you.

I fixed your problem. You had a colon in a place you’re supposed to place an equals sign and you don’t need that second Rigidbody part. Also you MUST place semicolons (:wink: after a statement. This is how it should look.

var Projectile : Rigidbody;
var speed = 20;


function Update () 
{

if( Input.GetButtonDown( "Fire1" ) )

{
    var instantiatedProjectile = Instantiate( projectile, transform.postion, transform.rotation);

    instantiatedProjectile.velocity = transform.TransformDirection(Vector3(0, 0, speed));

    Physics.IgnoreCollision(instantiatedProjectile.collider,transform.root.collider);
}
}