I’m using Orthello 2d to try and develop a 2d game in Unity, and I’m encountering a problem I have no idea how to deal with.
I’ve got two scenes - one is a level scene, which shows you which level you’re in (using a gameobject that remains between scenes and contains the level number), and one is the game scene.
When you win the game scene, the level is increased by one, and the level scene is loaded with Application.LoadLevel()
.
My problem is, that after once or twice that the game is won, the level increases by one, and then after the game scene is loaded I start getting these errors:
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
OTObject.get_worldPosition () (at Assets/Orthello/Standard Assets/OT/_Base/OTObject.cs:1121)
OT.Drag (.OTDragObject o, Vector2 pos) (at Assets/Orthello/Standard Assets/OT/_Base/OT.cs:1988)
OT.DragControl (.OTObject dragObject) (at Assets/Orthello/Standard Assets/OT/_Base/OT.cs:2076)
OT.Update () (at Assets/Orthello/Standard Assets/OT/_Base/OT.cs:2256)
Since this is pure Orthello code that is giving the error, I have no idea even where to start. Has anyone ever encountered something like this? Any ideas what possible reasons could cause this error in Orthello 2d?
Edit:
Through trial and error, I figured out it happens only when the level ends (and I load a new level), while dragging an object with the mouse (orthello draggable object). Same thing doesn’t happen when using mobile and dragging with touch. Any ideas on how to fix it?