Hey Everyone. I Have been trying to figure this out for about 3 days now and have NO luck. So i’m trying play around with networking with a top down style game. the characters rotation follows the mouse location. The character always faces the mouses direction. It works perfect on the Server and i can see the servers character rotating on the client screen, but I just cant get my clients character to rotate. when playing with a dedicated server I cant get any rotation from any client characters.so whats the deal? Below are some blueprints of what i have so far.
I have no idea what i’m doing so if these blueprints are very bad feel free to tell me. id much rather start from scratch then spending another 3 days trying to find the answer. Although i value all of your suggestions and anything would help, if you can provide a blueprint example of the points you are trying to get across that would help me tremendously. Thank you all!
The server and client are probably both replicating the mouse location at the same time so seems the server-side pawn (all pawns which have a client, also have a server side) overrides whatever the client tries to send.
If you are going to update the rotation per tick, then it would be a good idea to use the character movement component (which already handles replication) instead of doing all that “manual” stuff
I can make an example project for you if are still having trouble with this.
I found a RotatingMovement Component. is this what I am supposed to use? I guess i am just very unfamiliar with what I’ve gotten myself into haha. I’m not even sure how to use the rotating Movement Component or the CharacterMovement component.
You need your player blueprint to be based on the Character class in order to use the CharacterMovement component (the character blueprints for most of the example projects such as ThirdPerson, FirstPerson, TopDown etc. uses this).
I used the TopDown example as test and I was able to do this by adding this into the TowDownCharacter BP:
Make you have “Use Controller Desired Rotation” enabled in the CharacterMovement component.
Then make you set the camera to be facing directly down (-90 degrees on the Y axis of the spring arm) or else you will probably have to do a trace instead of using FindLookAtRotation.
Also I deleted all the stuff from the TowDownController BP, you only need to enable the mouse cursor in there.
ok so turns out it has caused my character to move relative to the character instead of relative to the world like id like for it to. for example. I press ‘w’ to move forward 5 meters, then I turn 90 degrees to the left and the pressed ‘a’ to move left 5 meters. I would end up where i started. any idea how to fix this?
Not really, it’s been years mate, the images are gone forever I guess (has happened to a lot of threads, since epic “upgraded” the forum unfortunately).
However I can try and help… from what I can read it seems that I used the TopDown example content that came with the editor and used it to make the character continuously rotate towards the cursor, also probably added the replication stuff so it works on clients.
Is that what you’re trying to do? or what exactly are you trying to accomplish? let me know… and perhaps I could try to recreate that blueprint TopDown example…
Thank you very much for your answer and for the pic, I’m sorry I’m so late, work has had me caged lately.
Yeah, it resembles a bit to that(in terms of replication), I came here because of a recommendation from another forum.
I was trying just to add a box(StaticMesh) that follows the camera’s ‘‘orbit’’ around a default 3rdPersonChar. It sounds very easy, but its movement wasn’t replicating in the clients at all.
It kinda goes like this:
I have a 3rd person Map by default.
I set it to Listen Server +2 clients
I changed the default GameModeBase for a GameMode because I’m been told the second one is specially made for multiplayer games.
on the (box) StaticMesh component I checked the box for replicating
Then first I made it children of the camera and later, of the spring arm and didn’t work either, even when I marked those to replicate too
After that tried to make the box mesh follow the camera movements via blueprints, didn’t work (that’s how I got here)
Finally and following an idea your pic gave me I tried this and it works, but the movent is very clunky (even marking Teleport of Sweep) and I’m thinking maybe there’s another way more efficient to achieve it, bc [Event Tick] + [Authority Switch], I think I’m making a mess here lol.