- Home /
what should I do whit this script to work?
I have an error. Plz help me! Assets/Code/Path.cs(12,9): error CS1525: Unexpected symbol }', expecting
(', )',
,', ;',
[', {', or
'
what's wrong?
using UnityEngine;
using System.Collections;
public class Path : MonoBehaviour
{
public Transform[] Points;
public IEnumerator<Transform>[] GetPathsEnumerator()
{
throw new NotificationServices
}
public void OnDrawGizmos()
{
if (Points == null || Points.Length < 2)
return;
for (var i = 1; i < Points.Length; i++)
{
Gizmos.DrawLine(Points [i = 1].position, Points[i].position);
}
}
}
What you really should do is learn to code. There is no way you should be trying to use a throw if you can't get your line endings right.
I strongly suggest going back to the beginner tutorials and starting over.
Answer by fafase · Jul 13, 2014 at 10:11 PM
throw new NotificationServices
should be
throw new NotificationServices();
THX!
$$anonymous$$y last error disappeared, but now i have a new problem:
Assets/Code/PathDefinition.cs(8,16): error CS0308: The non-generic type `System.Collections.IEnumerator' cannot be used with the type arguments
Answer by da_player16 · Jul 13, 2014 at 11:33 PM
This is your line of code with the new error.
public IEnumerator[] GetPathsEnumerator()
I dont think IEnumerator cane be used GetPathsEnumerator Plus I think you need to go take a look at the unity scripting tutorials. Your previous error was because of syntax which is essential to know if you want to do any coding.
Link to the unity3d scripting tutorials http://unity3d.com/learn/tutorials/modules/beginner/scripting
Your answer
![](https://koobas.hobune.stream/wayback/20220613153958im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What's Wrong With This Script? 1 Answer
Object reference not set to an instance of an object. 0 Answers
Script is causing crashes and i Don't know what to do. 2 Answers
error CS1729 1 Answer