Erase residual movement from pawn possession

I have Ship_BP and PlayerCharacter_BP blueprints. I am not trying to simulate any sort of buoy physics or anything with my naval ship, but I am running into a funny bug where my playercharacter continues to receive the movement input of the ship even after I re-possess my PlayerCharacter_BP pawn.

I set up a movement system similar to Assassin’s Creed: Black Flag where there are four movement indices, each with a different max speed. When the user clicks forward/backward, the speed index increments/decrements, and I set the max speed of the floating pawn movement. The ship then moves along every tick at the max speed of the corresponding speed index.

I ran into a problem where the ship would stop moving if I repossessed my playercharacter pawn, and I figured it was because the ship pawn needed a controller to receive movement input. I now store the initial controller in a variable and when the player controller repossesses the playercharacter pawn, I possess the ship with the aicontroller.

Now when I repossess my player character pawn, the ship continues to move along as expected, but the playercharacter pawn also receives a movement input in the same forward vector as the ship. I have tried to clear the movement input, disable and then re-enable movement on the charactermovement component, but it hasn’t worked.

Can anyone help explain why my playercharacter pawn would still be receiving these residual movement inputs?


Update: I tried to use the disablemovement node in my playercharacter_bp on possession, but I’m still able to move around. I wonder if the floatingpawnmovement component has overridden the charactermovement component or something? I can still move around with the charactermovement component, but the displacement from the aicontroller/floatingpawnmovement is also being applied to my playercharacter pawn.

I’m a silly guy. I never detachfromactor when I repossess my playercharacter pawn, so it is still attached as the ship moves. When I detach it all works great.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.