Help Scripting problems!

I keep getting 3 errors with this script.
1.Assets/Scripts/Player Scripts/Targetting.cs(31,22): error CS0547: `Targetting.TargetEnemy’: property or indexer cannot have void type.

2.Assets/Scripts/Player Scripts/Targetting.cs(33,17): error CS1014: A get or set accessor expected.

3.Assets/Scripts/Player Scripts/Targetting.cs(14,29): error CS1525: Unexpected symbol `AddAllEnemies’

Here is the script:

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Targetting : MonoBehaviour {
public List targets;
public Transform selectedTarget;

// Use this for initialization
void Start () {
     targets = new List<Transform>();
	selectedTarget = null

public void AddAllEnemies()
       GameObject[] go = GameObject.FindGameObjectsWithTag("Enemy");
	   foreach(GameObject enemy in go)

public void AddTarget(Transform enemy)

private void TargetEnemy
	selectedTarget = targets[0];

// Update is called once per frame
void Update () {


@Petroz already mentioned this, but naming it “Help Scripting problems” and tagging as “help” isn’t particularly useful. Please take a look at the FAQ, and follow the basic guidelines.

As for the problems…

  • You have “private void TargetEnemy”, when it should probably be “private void TargetEnemy()
  • You’re also missing a semicolon from the 4th line: “selectedTarget = null

I haven’t compiled this myself, with those errors fixed, but that should clear up at least some of the problems.