Error 1525 and 1526 . Space Shooter Tutorial Problem

Showing error 1525 1526

error message error CS1525: Unexpected symbol ,', expecting ;’
CS1526: A new expression requires () or after type

                    GetComponent<Rigidbody>().position = new Vector3 (

		Mathf(GetComponent.<Rigidbody>().position.x, xMax, xMin),
		0.0f,
		Mathf(GetComponent.<Rigidbody>().position.z, zMax, zMin)
		);

Are you using UnitScript or c#?

Your first GetComponent is using the c# syntax, the second is using the UnitScript syntax for generic methods. That’s one issue.

The second issue is that you’re using Mathf without any of the static functions/methods, what method are you trying to use? Are you Lerping? Are you trying to Clamp?

if c#:

GetComponent<Rigidbody>().position;

if in UnityScript:

GetComponent.<Rigidbody>().position;

Please check out the Mathf class and use the method in your code that you intended.