Pulling a Box along a slope

Hello,

I have created a simple side scroller blueprint project.
The scene includes a simple platform, the SideScrollerCharacter and an a Box static mesh. (both of them are standing on the platform)

I am trying to figure out the steps to enable the character to pull the box backwards with him as he moves back.

This is the behavior I am trying to achieve:

  1. The character will be able to start pulling the box after pressing the ‘E’ key when close enough to the box.
  2. The box will move together with the character as he moves backward (after pressing the ‘E’ key).
  3. The box will follow the floor topography, meaning that it needs to remain on the floor. (when being pulled)
  4. The character will release the box by pressing the ‘Q’ key. In this case, the box would respond well to slopes (meaning slide along the floor based on the physics)

Any suggestions?

Thanks

My idea would be to use physics since it’s the hardest part of your feature. You probably don’t want to recreate the reaction to slope and gravity yourself do you ? So I’d start from a physical object, and simply condiser the player character’s pull has a force. You can set this force in the direction of the player’s hand socket (maybe reducing the Z componant of the vector if you want the box to stay on the ground), and change this force’s magnitude depending on the distance to this socket. How does that sound to you ?

Hey there,

Thanks for the advice. I have tried it and it works nicely with one issue. The force causes thr box to roll, which is not the desired behavior. I have already constrained the x axis because it is a side scrolled. Any suggestions? Would a constraint component on the box do the work?

Thanks

Hey there,

Thanks for the advice. I have tried it and it works nicely with one issue. The force causes thr box to roll, which is not the desired behavior. I have already constrained the x axis because it is a side scrolled. Any suggestions? Would a constraint component on the box do the work?

Thanks