11-03-2019, 08:41 AM
(This post was last modified: 11-03-2019, 08:50 AM by josemendez.)
(11-03-2019, 03:16 AM)Richard Wrote: There was a compile error.
New error happened.
NullReferenceException: Object reference not set to an instance of an object
ClothTornEvent.OnEnable () (at Assets/ClothTornEvent.cs:16)
NullReferenceException: Object reference not set to an instance of an object
ClothTornEvent.OnDisable () (at Assets/ClothTornEvent.cs:22)
There's no ClothTornEvent class in Obi. That's a file you created, how am I supposed to know what's wrong with it? Assuming you copied the one I provided verbatim, this error refers to empty lines in the original script, so you must have modified it.
Make sure the cloth variable is not null (my script uses the RequireComponent attribute to make sure there's a cloth component in the object, so "cloth" can never be null).