NetworkShow and CheckObjectVisibility limiting visibiliy management flexibility (and does not work as intened in documentation)
Maintainer thường phản hồi trong vòng 3 ngày
@NoelStephensUnity đang làm issue này rồi.
Từ ngày 5/10/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is your feature request related to a problem? Please describe.
Using a NetworkShow and CheckObjectVisibility is known to be impossible, and there were already some discussions about it in the past (see https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2546 and https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2609 )
A resolution of the above issues was an introduction of SpawnWithObservers property on NetworkObject. That indeed solved situations where it was necessary to spawn object with no observers. However, in my case, I want to spawn a player object with owner-only visibility, and later add additional objects. However if I do it with:
go.GetComponent<NetworkObject>().CheckObjectVisibility = ((cId) =>
{
return cId == go.GetComponent<NetworkObject>().OwnerClientId;
});
It results in fully blocking me from any further network visibility management with NetworkShow / NetworkHide.
Interesting that the documentation tells that the above approach is actually valid:
https://docs-multiplayer.unity3d.com/netcode/current/basics/object-visibility/
It's said that CheckObjectVisibility is checked only at object spawn, and it's advised to use NetworkShow/NetworkHide after that. However currently it's not how it works, and it's necessary to both update the delegate method and do NetworkShow every time I need to show some object to some client. I feel there is a redundancy in updating a delegate in addition to NetworkShow.
Describe the solution you'd like
- Currently, in my local branch of NGO I just commented out a visibility check in
NetworkShowthat prevents the method from doing what is supposed to do. This is the fastest solution. - More beautiful solution would be to have a new argument to spawn a function to setup initial observes of the object:
SpawnAsPlayerObject(clientId, observers: new List<ulong>{.....});
Spawn(observers: new List<ulong>{.....});
- Or as it was proposed previously in https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2546 some sort of new delegate such as
CheckObjectInitialVisibilitywould also fix the issue
- Ngôn ngữ chính
- C#
- Star
- 2.3k
- Fork
- 465
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 39
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Unity-Technologies/com.unity.netcode.gameobjects
-
TimeSyncMessage is sent reliably, so a late one resets the client clock backwards and stalls its NetworkTransformsCó thể đã có người làm @reginaldalfret đã nhận 8 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Unity-Technologies/com.unity.netcode.gameobjects#4249 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
NetworkTransform: half-float base update dropped as out of order when UseUnreliableDeltas is on, so later deltas decode ~2 m offCó thể đã có người làm @NoelStephensUnity đã nhận 8 ngày trước. Đang mởport:3.x-completed priority:medium stat:imported type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
Unity-Technologies/com.unity.netcode.gameobjects#4248 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Tracking type:feature-2.x
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpyĐang mởTracking type:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
priority:medium stat:imported type:feature type:feature-2.x
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Unity-Technologies/com.unity.netcode.gameobjects#3706 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Unity-Technologies/com.unity.netcode.gameobjects
Issue tương tự
-
hand-to-AI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Typed MINID rejects numeric thresholds with a leading plus sign accepted by Redis and ValkeyĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
DXF with empty names failsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug python
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
Maintainer thường phản hồi trong vòng 13 ngày