Open Katerlad opened 8 months ago
If this is such a small use case that it gets passed off, I can see that, however... I ran into it and it took hours of my day to figure it out, which pissed me off enough to deep dive into it so others who may build prefabs like me do not run into similar problems.
Do you know if this happens in V4? If not, going to mark this as wont fix.
I'll load up the example project and upgrade to 4 and see. Give me like 1 hour.
Yes doing the same steps as above in that exact order causes the problem in 4.1.6.
It just seems like there is some cleanup and checks that need to be done on the fishnet side, when a prefab is being created from a child of another prefab.
I Know some people run into the the initial warning all the time, but after removing the network object and let fishnet auto reapply it, the problem goes away.
If you do more things while the problem exists, then you get stuck in this state where everything is corrupt and you have to remove the Network Behavior. Luckily I did test that you can copy component values, and paste them so you don't lost all your preset variables.
But if there is a way for Fishnet to more gracefully handle these prefab scenarios, less people will have to bump into these small snags that add up.
Again though, there may be some unity limitation that is why this is happening and there isnt, anything you can do but IDK if you've really looked into it either ;)
Marked a bug, low priority for now.
For me, i commented automatically add NetworkObject line in TryAddNetworkObject method from NetworkBehaviour, that make prefab broken, so i do everything manual. Also i add button, for prefab regenerate nested network objects, that also helps. After this, everything almost always works well.
Is this still an issue @Katerlad ? That system got a big rework recently.
Queued to close in 2 weeks if there is no new activity.
I unfortunately do not have the time to test this out, I did see that someone commented on the priority help post I made in discord with the same issue asking if this is going to be fixed. Not sure if he was running into the same exact problem or not. Here is the link to the discord post where the other user mentioned he had the same problem.
https://discord.com/channels/424284635074134018/1223395408743497791
No worries. I'll get to it eventually.
General Unity version: Fish-Networking version: 3.11.18 Discord link: https://discord.com/channels/424284635074134018/1223395408743497791 ** Above, post a link from our Discord where you troubleshot the issue (on Discord click the three dots next to the message, then Copy Message Link). Issue may be closed out if this is not included.
Description A clear and concise description of what the bug is.
Please Read Carefully, this isn't
just the spamming of the tryAddComponent Warning, there is something bigger at play here.
When Creating Nested Prefabs with Network Behaviors on the prefab, the NetworkManager can get in a state where it AssetHashPath Errors occur and NetworkManager Becomes null on game startup.
Replication Steps to reproduce the behavior:
There are a couple different ways to get it into this state, but here is the way I found works the most. To Reproduce
You have to remove the network behavior itself and read it, and imagine having to do that on a bigger project where you have varioables all set up ( Thats what we had to do)
Expected behavior I expect to be able to add and remove Nested Prefabs to a Prefab and fishnet gracefully handle any use case thats thrown at it. Cleaning up the game object properly if possible without Unity Limitations.
Game Build Files See Build File Below to see Issue in action ChildPrefabBug.zip