Unsafe part will be removed in the next update since Unity updated their API to include a function for copying from NativeArray to Array and vice versa.
I will check this on Friday when I am back in office. Crest probanly caches something on their end whoch causes the problems. Supplying different i_ownerHash could solve the problem.
OK thanks, I did a little bit of digging, haven’t found a solution yet, but it looks like Crest has an array that’s sized at 4096. Then when synchronize gets called it’s mistakenly(?) appending to the sample count. I tried changing the owner hash and also calling a remove function that’s on the coll provider, neither seemed to work. Might need to put up an issue in the Crest repo.
I ended up adding a deinitilize hook to the water provider class. So it calls deinitialize and then initialize again. I did this to fix an issue with leaking water sample classes with UWS when calling Synchronize, It’s possible that calling initialize again is breaking the Crest integration. Let me check that tonight.
Edit: Yeah, looks like you can disregard the above errors, I reverted the changes I made to the WaterObjectManager and the Crest integration seems to be working fine.
I currently have a WaterObjectManager that gets set to Don’t Destroy On Load, so it persists across scenes. Now what happens is that my main menu scene queries heights correctly, but as soon as I switch to another scene with its own Crest OceanRenderer, the height queries stop working.
So I tried putting a WaterObjectManager in each scene and disabled the Don’t Destroy On Load script, but now when it loads, I get the error messages that I pasted earlier and everything falls through the water.
It seems like re-creating the CrestWaterDataProvider is causing issues, however if it’s not re-created it doesn’t get a reference to the new OceanRenderer and doesn’t query any heights.
Edit: I came up with a workaround. It seems the ring buffer in Crest’s QueryDisplacements needs to be reset. The only way to do this currently is to cast the collProvider to QueryDisplacements and disable then immediately enable it. I added a Synchronize method to the Crest DataProvider that gets called when Synchronize is called on the WaterObjectManager in order to do this. I messaged the Crest Dev on discord about this also.
Edit2: All right, I tried to reproduce in the Demo Scene that comes with DWP2 and was unable (I even added a Synchronize button) and it seems to work fine after increasing the max query count to 8192, because at 4096 it just fails immediately.
But I think the issues with calling Synchronize were self inflicted. I put up an issue in the Crest github about the max query count.
Hello, I’ve just tried setting up a scene for the first time. i have a water object manager, a ship i made myself, a prefab of the motorboat from the demo and a water plane(stylized water) and my ships including the prefab from your demo keep falling straight thru the water. i know engine and rudder work fine. Not sure what im doing wrong. I also have the water tagged as Water.
please help
I bought this pack, and I have a popup that says “First time DWP2 setup” with a set of instructions, but there’s no way to close the popup and it blocks my Unity screen. It comes up when I close and reopen the project in Unity too.
He may not be getting the notices from Unity, I know that seems to happen a lot.
Try getting him through email or PM. I know he is still around and is usually quick on issues.
Website: http://nwhcoding.com
Email: info@nwhcoding.com
has anyone had any luck trying to get a character to swim using this asset? Have been working through with Invector character controller and will keep you guys updated, but wondering if anyone has had any luck as of yet
Hello and sorry for the delayed response. For support questions please contact me at nwhcoding@gmail.com as the forums tend to just cut off notifications on one thread without any reason.
Make sure that under Project Settings > Player you have defined “DWP_CREST” or whichever scripting symbol is appropriate for your water. There is a list in the manual of all available scripting symbols.