# Replicating meshes affected by physics

**URL:** <https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821>\
**Category:** World Creation\
**Tags:** Replication, physics-objects, unreal-engine, Physics, Blueprint, question\
**Created:** [June 24, 2015, 12:36am UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821 "2015-06-24T00:36:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClansFear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClansFear](https://forums.unrealengine.com/u/ClansFear)\
**Post date:** [June 24, 2015, 12:36am UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/1 "2015-06-24T00:36:53Z")

</div>

I’ve searched a lot and no solutions has helped me. When I create a BP of any static mesh and let it be affected by physics, once interacted by any client it goes out of sync. The client who pushed the object can see it pushed much further than other clients. How do I fix that using BPs?

---

<div class="post-metadata">

**Author:** ![vanlacke](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vanlacke](https://forums.unrealengine.com/u/vanlacke)\
**Post date:** [June 24, 2015, 1:45am UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/2 "2015-06-24T01:45:04Z")

</div>

You need to replicate the position of the mesh to all clients.

If you know about replication already this’ll be easy… Lemme know if you need more info

---

<div class="post-metadata">

**Author:** ![ClansFear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClansFear](https://forums.unrealengine.com/u/ClansFear)\
**Post date:** [June 24, 2015, 11:02am UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/3 "2015-06-24T11:02:28Z")

</div>

It’s my first take on the networking in Game Dev so I’m probably missing something. I thought that checking “Replicate” and some of the related checboxes in the blueprint of the affected object. Could you help me further?

---

<div class="post-metadata">

**Author:** ![vanlacke](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vanlacke](https://forums.unrealengine.com/u/vanlacke)\
**Post date:** [June 24, 2015, 6:51pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/4 "2015-06-24T18:51:28Z")

</div>

Well, first let me say that you should check out the networking videos made by UE4, and start messing around. MP physics is easy, but only once you really understand networking, imo.

The issue you’re having is that physics is being calculated only on the client who pushed the object… For them to be all in sync, you need to send the new position data to all clients.

Here’s a BP I made real quick to show you. It’s just right click to add impulse, and everything is ran on the server. There could be many improvements you could make yourself… This is bare bones. And of course once you understand how this works you could make your own way of doing it:

 ![47690-mpphys.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/d/57d8391813dc05461c136acbf49e11be7a9649ca.png)

And here’s a video showing it in action:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/f/06f56fc02aa0a813f577069235e9bbde82117c9a.jpeg "2015 06 24 1140 42") ](https://www.youtube.com/watch?v=TMva-RjFsYQ)

---

<div class="post-metadata">

**Author:** ![ClansFear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClansFear](https://forums.unrealengine.com/u/ClansFear)\
**Post date:** [June 24, 2015, 7:27pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/5 "2015-06-24T19:27:54Z")

</div>

Thanks, I’ve watched all but last networking videos already and I thought that built in replication would take care of physics as well. Then I tried to do something like your BP but it didn’t work. Great thanks for your example and time!

---

<div class="post-metadata">

**Author:** ![vanlacke](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vanlacke](https://forums.unrealengine.com/u/vanlacke)\
**Post date:** [June 24, 2015, 7:35pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/6 "2015-06-24T19:35:18Z")

</div>

I also assumed there was some way the engine would handle physics… But I couldn’t find a way, so the solution for me was to just update the positions to all clients.

What didn’t work exactly when you tried it?

---

<div class="post-metadata">

**Author:** ![ClansFear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClansFear](https://forums.unrealengine.com/u/ClansFear)\
**Post date:** [June 24, 2015, 8:17pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/7 "2015-06-24T20:17:27Z")

</div>

That’s a difficult question to answer, I set it up according to my logic, and I just didn’t get any results, it didn’t update. I don’t even have the blueprint already.  
Could you tell me what should call your AddImpulse event so that it receives Impulse variable?  
And also what could call UpdateObject?

---

<div class="post-metadata">

**Author:** ![vanlacke](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vanlacke](https://forums.unrealengine.com/u/vanlacke)\
**Post date:** [June 24, 2015, 8:24pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/8 "2015-06-24T20:24:06Z")

</div>

Add impulse is setup like this:

Right click → get physics component of actor I am facing (in this case sword) → add impulse

 ![47708-right+click.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/9/829bfdf699331990d5143d0d3ce799fb33209c20.png)

 ![47709-camhit.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/c/f4cb7f55f1d087cf7e5f6837b2ee4e11e6e9511d.png)

Both CamHit & UpdateObject are fired by Event Tick

![47710-event.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/a/2aa59ef48c1793bb0423d834bbd2b47f62c5e429.png)

---

<div class="post-metadata">

**Author:** ![ClansFear](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClansFear](https://forums.unrealengine.com/u/ClansFear)\
**Post date:** [June 24, 2015, 11:32pm UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/9 "2015-06-24T23:32:22Z")

</div>

I see now, I wish I could come up with such a solutions myself, I’ll try to do it my way basing on your concept.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cbf8aac6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cbf8aac6](https://forums.unrealengine.com/u/anonymous_user_cbf8aac6)\
**Post date:** [April 25, 2017, 12:22am UTC](https://forums.unrealengine.com/t/replicating-meshes-affected-by-physics/322821/10 "2017-04-25T00:22:30Z")

</div>

Hey, Does anyone have a tutorial for doing this? I know that the replication topic after understanding could be really easy, but I just can’t do the Physics handle replication :C. Please if you can help me!!
