Greetings people.
Almost half a year ago I switched my multiplayer project to use Unity DOTS framework, and since then I have been addicted to it.
It is amazing!
HOWEVER…
I soon found out that, just like in Netcode for GameObjects you can’t create nested ghost prefabs!
Example post saying that is isn’t possible at the moment:
you can’t use A if there is a prefab B inheriting A
Which means that you need to create multiple prefabs, and then create systems that link specific references between them and so on.
And so, for the past 3 months, I was working on solving this issue. (but mostly just learning ecs and netcode)
And the solution is complete!
-Features:
-
Nested ghost prefabs
-
All references will be saved
-
Works in build
-
Can be dynamically spawned or prespawned in scene!
-
Networked joints if you also install Joint Modificators!
-What still needs to be done:
-
Add more comments everywhere to explain how to fiddle with it
-
Cleanup
-
New Entity references in Managed components, that have been applied on the server as the prefab is spawned, will be nullified (who even uses managed components anyway?) But this problem requires unity employees to create an easy to use entity remapping command into EntityCommandBuffer, that does not replace references not found in EntityRemapingArray with Entity.Null
Also introducing Joint Modificators:
-
The ability to easily add your own components onto joints
-
Also includes a Configurable Entity Joint (configurable physics joint but for entities)
And a very basic template project using both of these packages.
Github links:
NestedGhostPrefabs:
JointModificators:
Template: