So. after finish one of my script, I found that I’ve use/pass NativeArray to my burst-enable job, but there’s no error or warning on my project. but WHY?
According to the document, I shouldn’t able to use NativeArray from the start right? since bool is non-blittable type.
1 Like
There is no problem with using bools with native collections
1 Like
Which documentation? Are you on the latest version?
Originally, this wasn’t supported. You’re right to say that it doesn’t sound like it should work, because bool isn’t a blittable type.
In the earliest versions of DOTS, people were using NativeArray instead.
But bool has such common usage, that Unity decided to add special support for it into Burst. So Burst sees that NativeArray, and knows what to do.
This is similar to when Unity added special support for serializing List in MonoBehaviours, even though they don’t normally support serialization of generic types.
1 Like
Thanks for the clarification!