Obi Official Forum
Issues getting Softbody working - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: Issues getting Softbody working (/thread-3198.html)



Issues getting Softbody working - kokutouchichi - 23-11-2021

Hello, new user here.

I read through the setup instructions and installed the necessary packages from here: 
http://obi.virtualmethodstudio.com/manual/6.3/backends.html#burst

I'm getting this error popping up on my console:

Assets\Obi\Scripts\Common\Backends\Burst\BurstMath.cs(681,74): error CS8377: The type 'T' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'

I've tried starting a new project with Unity2020.311f1 and Unity 2021.1.5f1 and I'm getting the same error in both versions. I'm using Obi Softbody 6.3

I've been searching on the forum for a bit and I can't seem to get Obi up and running. Cheers in advance for any guidance or suggestions. Thanks!


RE: Issues getting Softbody working - josemendez - 23-11-2021

(23-11-2021, 04:55 PM)kokutouchichi Wrote: Hello, new user here.

I read through the setup instructions and installed the necessary packages from here: 
http://obi.virtualmethodstudio.com/manual/6.3/backends.html#burst

I'm getting this error popping up on my console:

Assets\Obi\Scripts\Common\Backends\Burst\BurstMath.cs(681,74): error CS8377: The type 'T' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'

I've tried starting a new project with Unity2020.311f1 and Unity 2021.1.5f1 and I'm getting the same error in both versions. I'm using Obi Softbody 6.3

I've been searching on the forum for a bit and I can't seem to get Obi up and running. Cheers in advance for any guidance or suggestions. Thanks!

Hi there!

Sorry for the issue, I'm unable to reproduce this. What package versions you've installed? Just so that I can test the same setup you have.

Edit: the error says the type T in this declaration:
Quote:public static unsafe void RemoveRangeBurst<T>(this NativeList<T> list, int index, int count) where T : struct

must be non-nullable, but it is constrained to be a struct so it already is non nullable...  Huh


RE: Issues getting Softbody working - kokutouchichi - 24-11-2021

I did the same as the other poster suggested in this thread: http://obi.virtualmethodstudio.com/forum/thread-3197.html

That seemed to work! Changing:

Code:

Code:
where T : struct

to
Code:

Code:
where T : unmanaged



RE: Issues getting Softbody working - josemendez - 24-11-2021

(24-11-2021, 04:07 AM)kokutouchichi Wrote: I did the same as the other poster suggested in this thread: http://obi.virtualmethodstudio.com/forum/thread-3197.html

That seemed to work! Changing:

Code:

Code:
where T : struct

to
Code:

Code:
where T : unmanaged

Yes! Sorry about it, it was a timing issue. As Obi 6.3 was released, Unity released a new version of the Collections package that requires making this change for it to work.

I'm uploading a patched version to the store as we speak. Sorry for the trouble!