Allowing the Client to Move a Character Locally

Hey,

I’m trying to allow the client to move a character that isn’t owned by them, specifically with AddMoveInput. Nothing happens when the client runs it though, so I’ve made a subclass of the CharacterMovementComponent in the hopes I can override or tweak things to allow this to happen.

I’ve been banging my head digging through the source code of the component and a bunch of related classes, but I canNOT figure out what’s actually blocking the move. I think its related to the networked LocalRole or RemoteRole, but where it specifically blocks what I’m after is a complete mystery to me. I’ve even tried changing these roles directly, but I probably did it wrong because it didn’t seem to change anything (it likely would’ve have consequences elsewhere anyways). I’m definitely in over my head on this, so any help would be really appreciated.

Thanks

And if you’re wondering why I’m doing this: its for NPCs with really low Net Update Frequencies, so I can have a lot of them without lagging the network, but of course that makes their movement laggy for clients. So I’ve made my own basic path follower that can also run clientside, where clientside movement can fill in the gaps between net updates. Only problem is, the client can’t actually make them move…

Can you use Ai move or something similar? Otherwise there is a flag somewhere in the CMC to allow local input but I can’t look it up right now.

Hey sorry for the late reply. That Character Movement Comp flag sounds exactly like what I need! When you have time please let me know if you can find it, I took a brief look for keywords but I couldn’t find anything myself

Also, not sure what you mean by AI Move, do you mean the standard AI Move To Tasks? Cause I explained below the main question that I need to work around it. Thanks though!

Try bServerAcceptClientAuthoritativePosition. It should be on the CMC.

I don’t see where you’re against AI move? Is it the update frequency ? The issue you may still have is not just network authority but ownership since the player can’t own AI characters.

But it’s worth a try

Unfortunately it didn’t work. I don’t think you get what I’m trying to do here, I’m sorry I must not have explained clearly enough. I’ll try again

As you know, NPCs have a very low net update frequency. This means when using standard Move To, NPC movement is noticeably choppy for clients, especially when turning. So my goal here is to allow the client to move NPCs with CMC clientside, so it can smooth movement between slow net updates. If clients are allowed to move NPCs along the same path as the server (but clientside too), net updates wont need to correct very much, and the client will get a smoother experience.

Only problem is that CMC just doesn’t allow it. AddMoveInput does nothing on clients, even with bRunPhysicsWithNoController being true. CMC is probably blocking it due to NetMode or Local Role, though I’m not entirely sure nor can I figure out how to bypass it

Sorry I wasn’t clear enough the first time, thank you for trying regardless

I think you’re looking for something like this.

If your movement can be purely deterministic then you can just turn off replicates movement and handle it locally but it would be complicated.

Could also possibly look into mover 2.0 I haven’t played with that much yet

Something else baffling and frustrating is that even with Replicate Movement off clients STILL can’t move Characters, at least not like this. It makes no sense…

I’ll keep that plugin in mind though. If I can’t find a fix for this I’ll give it a closer look since I’m desperately trying to avoid having to write my own pawn movement. Thanks for the suggestion!

yeah it’s just how the CMC is designed since I think it handles replication itself. So you’re fighting against it. You could probably subclass it but either way it’s a big job. How many NPCs are you running? Maybe check how that matrix demo did it?

Didn’t even know it was multiplayer, that’s a good idea I’ll take a look thanks