Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not Working: "Refresh In-Scene Prefab Instances" #3067

Closed
zachstronaut opened this issue Sep 17, 2024 · 7 comments · Fixed by #3084
Closed

Not Working: "Refresh In-Scene Prefab Instances" #3067

zachstronaut opened this issue Sep 17, 2024 · 7 comments · Fixed by #3084
Assignees
Labels
priority:high This issue has high priority and we are focusing to resolve it stat:imported Status - Issue is tracked internally at Unity type:bug Bug Report

Comments

@zachstronaut
Copy link

Using the "Refresh In-Scene Prefab Instances" contextual menu on a prefab doesn't actually make any changes to the scenes that use the prefab. I have to manually go into the scenes in question and toggle the prefab gameobjects on/off in order to get Unity to recognize the new network guids as a dirty state that can be saved.

@zachstronaut zachstronaut added stat:awaiting triage Status - Awaiting triage from the Netcode team. type:bug Bug Report labels Sep 17, 2024
@NoelStephensUnity
Copy link
Collaborator

Hi @zachstronaut,
What version of NGO are you using?
Also, are the prefabs in-scene placed or are they dynamically spawned and included in a Network Prefab List?

@NoelStephensUnity NoelStephensUnity self-assigned this Sep 17, 2024
@zachstronaut
Copy link
Author

zachstronaut commented Sep 17, 2024

NGO 1.9.1 and these are in-scene placed prefabs that had a NetworkObject added to them so they needed to be updated in the scenes that used them so that unique network guids would get generated. Unity 2022.3.10f1, btw.

If you are not able to easily repro the problem (problem being: using the context menu from the prefab, seeing the popup load through the scenes, but then not actually have any changed files afterwards) -- like if this requires something else going on to reproduce -- then my one theory for you is that this prefab went from not networked at all to having a new NetworkObject at the top level AND adding a new nested child prefab that was already networked and already had a NetworkObject.

@NoelStephensUnity
Copy link
Collaborator

then my one theory for you is that this prefab went from not networked at all to having a new NetworkObject at the top level AND adding a new nested child prefab that was already networked and already had a NetworkObject.

That is very helpful...just getting back from a short break (needed some rest... 😹 ) and will be looking into this sometime tomorrow.

@zachstronaut
Copy link
Author

Welcome back!

@NoelStephensUnity NoelStephensUnity added stat:Investigating Issue is currently being investigated priority:high This issue has high priority and we are focusing to resolve it stat:import Status - Issue is going to be saved internally and removed stat:awaiting triage Status - Awaiting triage from the Netcode team. stat:Investigating Issue is currently being investigated labels Sep 27, 2024
@NoelStephensUnity
Copy link
Collaborator

@zachstronaut
Ok, I have replicated the issue and will work on getting a PR up by Monday. I am also going to provide logging of the results when using this tool so you can verify the NetworkObjects you would expect to be updated are updated. Just need to narrow down why the OnValidate is not recognizing the updated component on the root/parent when you add a NetworkObject to it.

Now that I have the steps to replicate it should be relatively easy to figure out.

@NoelStephensUnity
Copy link
Collaborator

@zachstronaut
Update your project's manifest to use this:

"com.unity.netcode.gameobjects":"https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#fix/in-sceneobject-networkobject-update-in-editor-tool",

Let me know if this provides better results on your end too (to verify the issue I replicated on my end is indeed the same issue you are experiencing).

If it works for you, then I will open a PR for this update.
👍

@NoelStephensUnity NoelStephensUnity added the stat:awaiting response Awaiting response from author. This label should be added manually. label Sep 28, 2024
@zachstronaut
Copy link
Author

This fix works as far as I can tell! Thanks, Noel!

@fluong6 fluong6 added stat:imported Status - Issue is tracked internally at Unity and removed stat:import Status - Issue is going to be saved internally labels Oct 7, 2024
@michalChrobot michalChrobot removed the stat:awaiting response Awaiting response from author. This label should be added manually. label Jan 15, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
priority:high This issue has high priority and we are focusing to resolve it stat:imported Status - Issue is tracked internally at Unity type:bug Bug Report
Projects
None yet
4 participants