DOTS: people disappeared after I added the Physics Body component

Getting nans again once i added the Physics Body component and set to Kinematic.

{In playing around if I set it to Static they didnt disappear, did move, but got no collision detection happening kinda as expected.}

On further testing I found if I set the destination position when spawning to something other than where they were initiated then the guys showed up and moved around.
I did notice some of them would disappear, presumably when they hit their destination, so I changed the closeness check in NewDestination from .1f to 1f and it was less obvious that people disappeared but hard to tell if a few were.

Dont know why any of this is happening…
Any guesses @Nathan_Farrer ?

A bug fix in 2020.3.26f1 and 2021.2.8f1 of Unity broke deferred arrays (and therefore all the dots packages).

On the Unity forums a fix has been posted.
Unity is aware of the problem and a fix is in progress.

I’ll post Tertle’s fix here for people who (quite rightly) don’t like clicking on links:

In the collections package, change AsDeferredJobArray allocator to Invalid from None

For anyone not sure how to do this

  • go into YOURPROJECTLibrary/PackageCache/
  • copy com.unity.collections@0.15.0-preview.21 into YOURPROJECT/Packages/
  • open com.unity.collections@0.15.0-preview.21\Unity.Collections\NativeList.cs
  • change line 599 from Allocator.None to Allocator.Invalid

The link for reference:
2021.2.8f1 broke AsDeferredJobArray and deferred jobs - Unity Forum

I’ve tested this fix and it works: please note in the image below:

  • the Unity version,
  • that the Physics Body is enabled and
  • that little blue people are happily frolicking around (hard to see in a static image but trust me :slight_smile: )

Now to do the last two lessons cracks knuckles

2 Likes

Good find!

1 Like

Privacy & Terms