x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Floating Pawn player (Def. Pawn Class) doesn't replicate movement.

(Full disclosure: I promise I've read absolutely everything on here regarding this and watched the Epic tutorials on basic blueprints networking already to no avail.) :)

When my Floating Pawn player (Default Pawn class) moves on a client, the movement does not replicate to the server nor any other clients. If I'm playing ON the listen server, its player pawn movement does, indeed, replicate to all other clients.

Yes, my pawn actor is checked to replicate/replicate movement/net load.

No, switching the parent from default pawn to character class won't work for a variety of reasons: 1. It breaks the floating pawn movement, even if you try to to add a floating pawn movement component after the fact. 2. I don't need the skeletal mesh hookups or animations, etc. 3. The character class seems hard coded against floating pawn movement (even though it exposes variables for any other type of movement! :) ) It would be a ton of hacking/inefficiency just to strip away the character components just to get it to replicate. And yet, it breaks the floating pawn movement anyway.

SO! My questions are: How can I get the basic floating pawn of a default pawn class to replicate properly? There has to be a simpler way than stripping the character class.
Replication works natively with the character class, so is there something to enable to get it to also work with basic pawns? How does any other mesh, or movable non-character actor get replicated if it doesn't live on the server?

Follow up: It's totally plausible that I don't know things :) and the character class CAN support floating pawn movement component but it's not as obvious as merely adding the floating pawn movement component like it was for the pawn class. I'd love to hear that someone got it to work!

Thank you ALL in advance!

Product Version: UE 4.12
Tags:
more ▼

asked Aug 11 '16 at 01:47 AM in Blueprint Scripting

avatar image

EchoHeadMatt
16 2 6 8

avatar image EchoHeadMatt Aug 11 '16 at 06:53 PM

Well I figured it out after referencing a lot of forum posts and trial and error! Like Tom did in his awesome post, all this happens inside your Pawn's blueprint. Mine inherits the default pawn class and has a Floating Pawn movement component added.

I have NO physics in my game, so I don't need to do anything with forces or physics. All physics are off on all blueprints/levels, etc.

I just need my pawns to have 6 DoF and go where I tell it to go, plain and simple!

Create two custom events and set them to execute on the server and check them as reliable.

I called the first event ServerTurn and added a rotator output, calling that output New Rotation.

I called the second event ServerMoveForward and added a vector output, calling that output New Location.

Simply add the InputAxis LookUp and InputAxis Turn events, and connect both to a Server Turn call you just added, attaching a GetActorRotation and its return value plugged into the New Rotation input.

Off of the ServerTurn custom event, simply connect it to a SetActorRotation event, connecting up the New Rotation output to the SetActorRotation's rotation node.

Then add InputAxis MoveForward event. Add a ServerMoveForward call and connect the two. Connect a GetActorLocation return value to the New Location node of the ServerMoveForward call.

Off of the ServerMoveForward custom event, connect it to a SetActorLocation. Then connect the New Location output from ServerMoveForward to the vector node of the SetActorLocation.

BOOM! All clients move on server and other clients!

I included a pic of the setup as well as the details panel of the base pawn.

avatar image EchoHeadMatt Aug 11 '16 at 06:53 PM

alt text

pawndetails.png (2.7 MB)
avatar image EchoHeadMatt Aug 11 '16 at 06:54 PM

alt text

avatar image Shohei Aug 11 '16 at 07:15 PM

This works for local test servers with little to no ping, but be aware it might not be ideal for release and you may experience rubberbanding due to a lack of interpolation or prediction.

avatar image EchoHeadMatt Aug 11 '16 at 07:34 PM

I was afraid of that. Are there functions or checks I can use in Blueprints to safeguard against rubberbanding that you know of?

avatar image Shohei Aug 11 '16 at 07:37 PM

Unfortunately this is out of my area of expertise. Luckily for you this specific system quite small and decoupled from the rest of your system. You can replace it later down the line once you get some more experience with the engine.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Most components do not replicate by default. While you may have set your actor to replicate be sure you have also checked that the component itself replicates, not just some arbitrary "bReplicateMovement" variable attached to ACharacter. Also note that APawn does not handle MovementComponents for you. If you want easy plug-and-play movement components with proper client->server replication you will likely need to use ACharacter.

With this said I didn't even know a FloatingPawnMovement component existed. It's highly possible that its client->server FSavedMove stuff isn't implemented. More on that can be found here (it is C++-based).

more ▼

answered Aug 11 '16 at 03:40 AM

avatar image

Shohei
956 30 5 39

avatar image EchoHeadMatt Aug 11 '16 at 04:28 AM

Is it possible to give ACharacter full floating (6DoF) movement? Is there a way to do all this with Blueprints?

avatar image Shohei Aug 11 '16 at 04:32 AM

I've never touched on that before, but I would think you can do that with any AActor without the need for a MovementComponent. My first line of thought would be to disable gravity on the actor (mesh). I'd hook up custom input events that would apply acceleration to the mesh according to the forward/up/right vector (and their negatives) and rotation for pitch/yaw/roll.

avatar image EchoHeadMatt Aug 11 '16 at 06:36 PM

Thanks for the info! After taking bits and pieces from tons of posts, I think I got something simple that works smoothly! I'm going to post in a second.

avatar image Mesket 5 days ago

Such a long, looong second....

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question