# Floating collider moves with player

**URL:** <https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299>\
**Category:** World Creation\
**Tags:** move-actor, unreal-engine, Physics, Collision, question\
**Created:** [May 12, 2021, 10:21pm UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299 "2021-05-12T22:21:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eje211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eje211](https://forums.unrealengine.com/u/eje211)\
**Post date:** [May 12, 2021, 10:21pm UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/1 "2021-05-12T22:21:54Z")

</div>

I have a boat actor that has a simple collider shaped like a box. In play mode, I can get into it and walk inside of it. With water simulation, it floats and all is good until I get to the edges of the collider. Then, the player drags the collider across the water and the land. I’d like to prevent that. I’m not sure how to do it. When the player actor gets to the sides of the collider, it should stop, not drag the collider along. How can I do that?

Based on @ ’s answer, I got this going on:

 ![338707-screenshot-2021-05-13-131923.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/7/987c15afa43e64173f3e8a1cf4cf857ea1bdd8ec.png)

But it only solves part of the problem: now the boat hardly moves at all. I need it to respond to the motion of the water from the **buoyancy** component but _not_ to the motion of the player pawn. There must be a way to simply do that. In Unity, I’d tell it to ignore any collider input that has the player gameobject as its source, but I’m guessing Unreal will be very different.

---

<div class="post-metadata">

**Author:** ![mindsurferdev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mindsurferdev](https://forums.unrealengine.com/u/mindsurferdev)\
**Post date:** [May 13, 2021, 4:38am UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/2 "2021-05-13T04:38:35Z")

</div>

Sounds to me like when the character is walking into a wall on the boat the character applies force to the boat in the direction the character is moving.  
When the player is not controlling the boat why don’t you use the **Set Physics Linear Velocity** and **Set Physics Angular Velocity** nodes to 0, 0, 0 on the boats simulating physics mesh.

![338693-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/3/f03c5a6f5381f9d67f0ede31a3e70d8aebf87772.png)

---

<div class="post-metadata">

**Author:** ![eje211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eje211](https://forums.unrealengine.com/u/eje211)\
**Post date:** [May 13, 2021, 11:00am UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/3 "2021-05-13T11:00:15Z")

</div>

I’m new to Unreal and I didn’t know about that setting. I’ll try that. Thanks! If it works, it was exactly what I needed. I’ll try it and let you know.

---

<div class="post-metadata">

**Author:** ![eje211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eje211](https://forums.unrealengine.com/u/eje211)\
**Post date:** [May 13, 2021, 11:30am UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/4 "2021-05-13T11:30:38Z")

</div>

@mindsurferdev Your answer solved most of it, but now the boat hardly moves at all. (I clamped rather than removed the velocity.) I still need the boat to respond to the **buoyancy** of the water, but still ignore the movement of the player. Basically, it should respond to _some_ hits, but not others. There must be a specific setting for that, but I don’t know which one it is. I’ve looked it up, but not found out what it is. This matches the real world: if I’m on a boat, the boat responds to the motion of the water (and a little to mine, but let’s ignore that for now), but I’ll be moving in relation to the boat. Me moving to the edge of the boat, will not make the boat move forward. But it won’t stop the boat’s motion in relation to the water either.

---

<div class="post-metadata">

**Author:** ![mindsurferdev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mindsurferdev](https://forums.unrealengine.com/u/mindsurferdev)\
**Post date:** [May 16, 2021, 3:56pm UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/5 "2021-05-16T15:56:40Z")

</div>

What if you apply **impulse at location** to the boat, at the player hit location, by the **velocity of the player** \* -1?

---

<div class="post-metadata">

**Author:** ![eje211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eje211](https://forums.unrealengine.com/u/eje211)\
**Post date:** [May 16, 2021, 6:06pm UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/6 "2021-05-16T18:06:13Z")

</div>

I was about to try something much more complicated, but I will try that. Thanks!

---

<div class="post-metadata">

**Author:** ![mindsurferdev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mindsurferdev](https://forums.unrealengine.com/u/mindsurferdev)\
**Post date:** [May 17, 2021, 4:27am UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/7 "2021-05-17T04:27:06Z")

</div>

Maybe multiplying it by -2 would work better I’m not sure 😕

You can also try: Stopping the player’s impulse if the player is walking into a wall on the boat. So that on event hit you check the **dot product** between the player’s **normalized velocity** and the **normal of the boat wall** and if it is at a certain angle you won’t apply velocity to the player. You might need to figure out how to ignore the floor of the boat tho 😕

Honestly, this option in Unity sounds **great** , I don’t think UE4 has this as I have faced a very similar problem and no one could help me either.

---

<div class="post-metadata">

**Author:** ![eje211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eje211](https://forums.unrealengine.com/u/eje211)\
**Post date:** [May 17, 2021, 9:51am UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/8 "2021-05-17T09:51:30Z")

</div>

I’m about to try it now. I’m a bit worried about actually applying the force and then removing it as opposed to not applying it at all, but it _should_ be only for one frame, so it should be okay. It may also be possible to do my “Unity solution” in Unreal in C++, but I must program this in Blueprints.

---

<div class="post-metadata">

**Author:** ![mindsurferdev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mindsurferdev](https://forums.unrealengine.com/u/mindsurferdev)\
**Post date:** [May 25, 2021, 6:17pm UTC](https://forums.unrealengine.com/t/floating-collider-moves-with-player/483299/9 "2021-05-25T18:17:41Z")

</div>

Hey @eje211, did you find a solution to solve your problem?
