- Home /
Question by
glenpyeldho · Jul 23, 2015 at 12:54 PM ·
errorspace shooter
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)
);
Comment
Answer by Landern · Jul 23, 2015 at 12:55 PM
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.