khoi
NNormal
•Created by khoi on 5/26/2025 in #🤝ask-a-question
Separating Realtime.Destroy() from OnDestroy when a client leaves/stops playing?
Okay, seems like using OnDestroy to respond to Realtime.Destroy() is an anti-pattern
7 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
@kapa.ai what's the behavior of Rigidbody.MovePosition in regards to RealtimeTransform? If I call it on my client, which owns it, will it move the rigid body on the remote client? or only the transform? (can those two things even get separated in unity?)
101 replies
NNormal
•Created by khoi on 5/16/2025 in #💭feature-request
Datastore Dashboard for Debugging
Okay great, I didnt realize you could click on the other window and it would just take over haha
7 replies
NNormal
•Created by khoi on 5/16/2025 in #💭feature-request
Datastore Dashboard for Debugging
Wait -- how do you get the Multiplayer Play Mode to work with VR and Normcore? Is there a guide on how to do this?
7 replies
NNormal
•Created by khoi on 5/16/2025 in #💭feature-request
Datastore Dashboard for Debugging
WOO didnt know about this
7 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
@kapa.ai so RealtimeTransform is just a special case of RealtimeComponent
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
@kapa.ai just to double check -- with a custom unowned RealtimeComponent besides RealtimeTransform, anyone can modify it right? Dont need to RequestOwnership before modifying it? Eg a custom realtime component to synchronize custom data does not need to have ownership flags to modify it
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
right -- for some reason I got the impression that only one client could own something and it would lockout other clients until cleared. But there is this snippet that is a big a-ha! "A RequestOwnership() call is only rejected if the RealtimeView or a parent RealtimeView is owned by a different client." from the RTT page.
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
So I think we should be good! Thanks Max.
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
Ok I misunderstood the docs, I thought you could not RequestOwnership if someone else owned it.
I think what we were running into was that the RealtimeView was owned by someone else so the RealtimeTransform was rejecting ownership.
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
" if you're trying to have the NPC have a RealtimeTransform just leave it owned by the last person to punch it? RequestOwnership() takes affect instantly and is rolled back if the server rejects it. So when I punch something, my client would request ownership and I'd see the punch effects instantly as the enemy barrels away."
This is what I'm trying to do exactly, you got it! My only question is, in my current set up a different client owns the RealtimeTransform at the time that I punch it because I want the positions to be the same for sure across clients. So I wouldn't be able to punch it, since someone else owns the RTT for authoritative NPC movement.
But it sounds like you are saying we should keep the NPC unowned and just simulate locally until a punch event happens. And there shouldnt be much noticeable desyncing if it's just simple movement.
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
Would this work?
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
@Max if i want to avoid desync, i should have someone own the enemy realtimetransform always, but then how can I design the game to clearownership at the right time?
I've been trying the avatar closest to the enemy always own the realtimetransform, if you aren't the closest avatar and you own it, ClearOwnership(). Presumably if you are the closest avatar, you are probably the next person to punch it.
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
The host (current owner) should call ClearOwnership() on the enemy's RealtimeTransform when it is appropriate to allow another client to take over (e.g., when the enemy is about to be punched or when a punch is detected).
-- How should I do this? Should the punching player send a RPC event if they get very close to the enemy to tell the owner to release it? That seems clunky... @Normcore Assistant
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
What is the best way to handle this:
- A single client is chosen as the "game host"
- They spawn the enemies and own the RealtimeTransforms of the enemies, so they control the enemies walking around
- Another player runs up and tries to punch the enemy --> How do I ClearOwnership and let the other player RequestOwnership when they want to punch?
@Normcore Assistant
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
But @Normcore Assistant will I see it moving locally?
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
In order to move an object with a RealtimeTransform component, your client needs to be the owner of the RealtimeTransform component RealtimeTransform.
So if neither client owns the Enemy which has a RealtimeTransform, it will just be stuck? @Normcore Assistant
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
Okay. And if the Enemy rolls to a stop and then becomes "unowned" due to ClearOwnership() triggering when an Enemy rolls to a stop, and both clients have Update running with rigidbody.MovePosition(forward), what happens? Do they overwrite each other and fight? @Normcore Assistant
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
Ok. Let's say I (client 0) punch enemy 1, I request ownership on that frame and then apply a physics for. Enemy 1 is now flying on client 0. On client 1, the normal Update loop is running with rigidbody.MovePosition(forward). I assume this does nothing because client 1 does not have ownership?
What happens in this case @Normcore Assistant
101 replies
NNormal
•Created by khoi on 5/14/2025 in #🤝ask-a-question
Punching networked enemies
Will one frame be enough time? @Normcore Assistant
101 replies