How to repair error CS0547 and CS8025

HI. I have problem with script:
using UnityEngine;
using System.Collections;

public class Shooter : MonoBehaviour {

	public Rigidbody bullet;
	public float power = 1500f;
	public float moveSpeed = 2f;
void Update{ {(transform.Translate(h, v, 0)} }  {
	
}

}

When i want to use this script , I see these errors :

  1. Assets/Shooter.cs(9,14): error CS0547: `Shooter.Update’: property or indexer cannot have void type
  2. Assets/Shooter.cs(9,57): error CS8025: Parsing error

Thanks , if you help .

It seems you have waaaaay too many of { } <-- these and missing () after Update. Your Upate function should just read : void Update() { transform.Translate(h, v, 0); }

Ive already tried every kind of format. So thats not the problem here im afraid.

1 Answer

1

Thanks , but this doesn’t work . Now I have these errors:
1.Assets/Shooter.cs(11,37): error CS0103: The name h' does not exist in the current context 2.Assets/Shooter.cs(11,40): error CS0103: The name v’ does not exist in the current context
3.Assets/Shooter.cs(11,27): error CS1502: The best overloaded method match for UnityEngine.Transform.Translate(float, float, float)' has some invalid arguments 4.Assets/Shooter.cs(11,27): error CS1503: Argument #1’ cannot convert object' expression to type float’

Script:
using UnityEngine;
using System.Collections;

public class Shooter : MonoBehaviour {

	public Rigidbody bullet;
	public float power = 1500f;
	public float moveSpeed = 2f;
void Update()
{
	transform.Translate(h, v, 0);
}

}