ecctrl icon indicating copy to clipboard operation
ecctrl copied to clipboard

Create two instances of ecctrl for online

Open algoritcom opened this issue 1 year ago • 3 comments

Hello, I am setting up a project in which I make the movement of the main character with ecctrl. The problem is that if I load another ecctrl for a second player, the movement that I apply to the main one also applies to the second, even if they are different references. I have tried creating two separate components, with different ecctrl and group references and it remains the same. Does anyone have any ideas on how to use it?

Thanks a lot.

algoritcom avatar Jul 31 '24 16:07 algoritcom

@algoritcom have you found a solution for this?

samuelndm avatar Sep 09 '24 06:09 samuelndm

I want to create another instance of ECCTRL with only physics and animation features, but I failed too. This problem is serious! If only the main player can use ECCTRL, the universality is significantly reduced.

geirdev avatar Feb 06 '25 01:02 geirdev

I have successfully set this up in production with a fork of ECCTRL.

The solution was to remove all internal dependencies on zustand and use an internal context provider for each character instead.

One caveat though is that the collider logic is quite heavy and does not scale well for multiple instances, so you are probably better off using a separate controller for NPCs and multiplayer instances of other players.

prnthh avatar Mar 06 '25 18:03 prnthh