-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant null reference exceptions in editor #136
Comments
Hello, same here I just add the script to a GameObject and appears errors on the console.
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced. And more, like 7 errors. I'm using Unity 2022.1.12f1 Thanks! |
same. And I need to start game , then there is no more null reference. But still can't see any curve in scence , then i need to click the ResetPath. There is a curve now. But I don't think it's a permanent solution |
Yes, this problem seems to happen in unity 2022, there is no such problem in 2021. |
I have this problem in Unity 2021.3.25f1
|
Unsure why this is specifically happening in 2022, but it looks like it's trying to initialize the _bezierPath variable in PathCreatorData.cs because its marked with the SerializeField attribute. When you add the component to your scene, _bezierPath is then set to not null and the null check in Initialize on line 46 in PathCreatorData.cs doesn't pass and the Bezier doesn't get created correctly. Removing [SerializeField] on line 12 (the one above _bezierPath) in PathCreatorData.cs fixes this for me. Probably not the best fix in the world but its doing the trick for me at the moment. [System.Serializable]
public class PathCreatorData {
public event System.Action bezierOrVertexPathModified;
public event System.Action bezierCreated;
[SerializeField] //<-- Remove this attribute
BezierPath _bezierPath;
VertexPath _vertexPath;
[SerializeField]
bool vertexPathUpToDate;
//Rest of the code
} EDIT nvm #135 seems like a more reasonable solution. I would do that instead |
As soon as I add a path creator script, I get the following error over and over again until I remove the component:
The text was updated successfully, but these errors were encountered: