How do I fix error CS1519?

I am getting error CS1519 and I don’t know why. If anybody can find out what’s wrong and give me tips on how to fix it, that would be great. I’m new to C# soooo yeah I’m noob.
Assets/Scripts/Gun1Script.cs(27,4): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration

And the script is

using UnityEngine;
using System.Collections;

/// <summary>
/// This script is attached to the blaster projectile
/// and it governs the behaviour of the projectile.
/// </summary>


public class Gun1Script : MonoBehaviour {
	
	//Variables start
	
	private Transform myTransform;
	
	private float projectileSpeed = 10;
	
	//Variables end	
	
	private bool expended = false;
	
	private RaycastHit hit; 
	
	private float range  = 1.5f
	
	// Use this for initialization
void Start ()
			
	{
		myTransform = transform;
	} 
	
	// Update is called once per frame
void Update() 
	{
		//translate projectile UP m8
		
		myTransform.Translate(Vector3.up * projectileSpeed * Time.deltaTime);
		
		if(Physics.Raycast(myTransform.position,myTransform.up, out hit, range) &&
		   expended == false)
		
		{
			//if collider has tag floor then 
			
			if(hit.transform.tag == "Floor")
			{
				expended = true;
				
				//make projectile become invisible 
				
				myTransform.renderer.enabled = false;
				
				//turn off light
				
				myTransform.light.enabled = false;
			}
		}
		
	}
}

You’re just missing a semicolon on the previous line, at the end of:

 private float range  = 1.5f

Hi I am getting the following errors

  1. Assets/Scripts/PlayerController.cs(47,3): error CS1519: Unexpected symbol `if’ in class, struct, or interface member declaration
  2. Assets/Scripts/PlayerController.cs(47,35): error CS1519: Unexpected symbol `namespace’ in class, struct, or interface member declaration
  3. Assets/Scripts/PlayerController.cs(48,2): error CS9010: Primary constructor body is not allowed
    I am new to C# so I don’t know much

And the script is

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class PlayerController : MonoBehaviour {

public float Speed;
public Text countText;
public Text winText;

private Rigidbody rb;
private int count;

void Start ()
{
	rb = GetComponent<Rigidbody>();
	count = 0;
	SetCountText ();
	winText.text = "";
}

void FixedUpdate ()
{
	float moveHorizontal = Input.GetAxis ("Horizontal");

	Vector3 movement = new Vector3 (moveHorizontal + 0.1f, 0.0f, 0.0f);

	rb.AddForce (movement * Speed);
}

void OnTriggerEnter(Collider other)
{
	if (other.gameObject.CompareTag ("Pick Up"))
	{
		other.gameObject.SetActive (false);
		count = count + 5;
		SetCountText ();
	}
}
void SetCountText ()
{
	countText.text = "Score: " + count.ToString ();
	if (count >= 30)
winText.text = "You Win!";

}
void OnCollisionEnter (Collision collision);
if (collision.gameObject.namespace == “Spikes”);
{
Destroy (collision.gameObject);
}
}

You are missing a semicolon at the end of private float range = 1.5;

Also, you are accessing renderer and light component wrong:

using UnityEngine;
using System.Collections;

public class asss : MonoBehaviour {

//Variables start

private Transform myTransform;

private float projectileSpeed = 10;

//Variables end    

private bool expended = false;

private RaycastHit hit; 

private float range  = 1.5f;

	// Use this for initialization
void Start (){
	myTransform = this.transform;
} 

	// Update is called once per frame
void Update() 
{
	//translate projectile UP m8

	myTransform.Translate(Vector3.up * projectileSpeed * Time.deltaTime);

	if(Physics.Raycast(myTransform.position,myTransform.up, out hit, range) &&
		expended == false)

	{
		//if collider has tag floor then 

		if(hit.transform.tag == "Floor")
		{
			expended = true;

			//make projectile become invisible 

			myTransform.GetComponent<Renderer>().enabled = false;

			//turn off light

			myTransform.GetComponent<Light>().enabled = false;
		}
	}

}

}