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"

replication for moving actor

I have a dedicated server with two clients.

If one character has an impact with some actor, this actor is bouncing from the character to a new place. However, another client observes another new location of the object. It looks like each client calculates the bounce itself.

I want to have all the movements of an actor on the server with exact representation for all clients. I played with replication setpoints, but it gives nothing.

Please help with setting for replication. Maybe something else is wrong.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 12 '18 at 04:55 AM in Using UE4

avatar image

SvarogZ
49 10 11 20

avatar image SvarogZ Oct 23 '18 at 01:14 AM

I still cannot fix an issue. I've created the standard scene for the third person and activated replication for static meshes (cubes) and projectiles (balls) as per stream from Epic. It works as was shown. However, standard Actor with StaticMeshComponent doesn't want to be replicated as regular StaticMesh.

  1. If I use StaticMesh on the scene, everything is good. It replicates absolutely correctly.

  2. If I use StaticMesh as Component for an Actor, it doesn't work.

I've tried all combination for settings of replication for the Actor. I've tried switch-on replication for the root component and StaticMashComponent one by one and both together as well. I've tried to switch-off physics for Client only. It looks like something doesn't work properly. Maybe it's me.

Could you advise, how to use replication of movement for Actors with StaticMeshComponents?

avatar image SvarogZ Oct 23 '18 at 05:47 PM

I have found an interesting thing. If StaticMeshComponent has a physics it can be moved, however, root component and Actor don't move. It means, if I bump the StaticMesh to another end of the world, physically Actor remains on the same place, where it was created.

I created two replicated variables for location and rotation and updated them if StaticMeshComponent changes the location, Every tick I changed a position of the Actor to be on the same place with the StaticMeshComponent. On the client, I've changed the position of StaticMeshComponent as well. This solution works, however, all movements on the client are not smooth enough.

I didn't find a description for the option "replicate movement". There is no visible effect from that option in my tests.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

"replicate movement" works just for a root component. For this feature, StaticMeshComponent must be chosen as "root".

If not, it is just changing location in reference to root component.

more ▼

answered Jan 09 '19 at 05:59 PM

avatar image

SvarogZ
49 10 11 20

(comments are locked)
10|2000 characters needed characters left

If you are using the Static Mesh Actor as you physics objects parent class, you can set the "replicate movement" flag on for that actor. This should do all replication automatically.

more ▼

answered Oct 12 '18 at 08:18 AM

avatar image

Eelis Otsamo
55 1 4 7

avatar image SvarogZ Oct 12 '18 at 09:15 PM

Yes, It should, but not. It does not matter a dedicated server or not. Even if I use Server and Client, bouncing is different. My StaticMesh is in different locations for server and client after the bouncing.

Please see the picture with settings.

[1]: /storage/temp/256348-question.png

question.png (20.8 kB)
avatar image SvarogZ Oct 12 '18 at 10:39 PM

I've tried to switch off physics and collision for clients only, however, an actual location of the actor is not passing to the clients.

(comments are locked)
10|2000 characters needed characters left
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