beeeenB
Normal2mo ago
13 replies
beeeen

How to modify RealtimeTransform?

I'd like to create a variant of RealtimeTransform (ideally inheriting it for compatibility) in order to meet specific needs of our game. We have fast moving platforms. When the players are on these moving platforms, their avatars appear to lag for other players, because they're synched with their world positions by RealtimeTransform in Rigidbody mode.

In the past, we've fixed this by creating our own script that synchronizes the positional offset of the player with respect to the moving platform. The avatar can then place itself with that positional offset so that they don't appear to be lagging off of the moving platform. However, this implementation isn't perfect and now I'm looking to improve it.

The ideal solution would be to inherit or copy RealtimeTransform and allow it to support relative positioning in Rigidbody mode. Is inheriting or copying the RealtimeTransform source code possible? I can see a boilerplate decomplied code in my IDE but I don't know if I trust that.

To be clear, this isn't local position synching with parents and such. As described in the docs RealtimeTransform in rigidbody mode must not be parented and uses world position.
Unless you're casually perusing the docs, you're probably here because you put a RealtimeTransform component on something and it's not working the way you expect. Well, you're in luck. This page is designed to explain how RealtimeTransform works and some of the thinking necessary to get it to do what you want.
Networked Physics | Normcore Documentation
Was this page helpful?