sync char

MidnightAleks

New member
Hi If I wanted to move a character on a client, how would I go about replicating the movement over the network? I was expecting to pass a vector and the controller would simply move according to it. The only obvious method is Move from UltimateCharacterLocomotion, I tried things like:

UltimateCharacterLocomotion.InputVector = new Vector2(-1, -.6f);
UltimateCharacterLocomotion.DesiredMovement = new Vector2(-1, -.6f);
UltimateCharacterLocomotion.LocalDesiredMovement = new Vector2(-1, -.6f);

But no luck, Justin on discord said "You should instead sync the transform and animator separately outside of the move method. This is what the PUN add-on does." But didn't provide a example. Can someone or Justin himself share some tips/example of how to approach networking. Cheers
 
Can someone clarify one thing: is the recommended network approach to disable the locomotion component on network characters and get the position from the sending client?
 
The UltimateCharacterLocomotion component should be disabled and then you would move the character depending on the networking implementation that you are using. No character controller code needs to run to move the character or sync the animations. As a result of this I'm not able to give an example. You'd sync the character just like you'd sync any other object using the networking implementation that you are using.

This is only for movement and animations. For things such as firing a weapon you do need to run some character controller code. For this you will need to implement the interfaces within the Networking folder. This is a really large subject though and is best accomplished by adding stubs for the interface and then implementing it on a case by case basis. The PUN add-on is a really good example of this even if you are not using PUN.
 
Top