Download

Add a cart to a player character

Hello,

I have a character BP, a simple walking human. I want to attach a cart to the character BP, with physics activated on the cart. However if i activate physics, the cart automatically detach from the socket.

How can i do that please ? Use socket in a different way ? Or with a different approach ?

Thanks to everyone !

I’m assuming what you want is the cart to be blocked by collisions instead of clipping. If you’re using “Character Movement Component (CMC)” for your character then you need a different approach.

CMC has a root collision capsule that overrides all other collisions actively. Meaning you can add other collisions to the character BP, but they won’t actively block, thus stop movement. Only the capsule will do this.

So to get around this you have to use collision overlaps to trigger events that disable movement input. I do have a post that covers this in pretty good detail (bp examples). Ironically it was for the exact same setup … character with a shopping cart. I’m sure if you searched a little in this category (BP visual scripting) you’ll find it.

Anyway the base principle is you add a collision box to the front of the cart. On overlap begin you set a var to true (disable forward input). In your character movement logic … Forward pressed → Branch (disabled forward input?) → false … process movement, true don’t. On end overlap set the var to false.

You’ll need to apply the same structure and logic flow to turning (rotation). So a collision the length and height of your cart on each side of it. This is going to be a trial and error process. Have to look at all possible movement directions that could/should block. The corners are going to be the hardest.

I’ll look for the post later. In the meantime …

https://www.youtube.com/watch?v=R1MbKVPRM60

Here’s the other post.

Hello RevOverDrive :slight_smile:

Thanks a lot for your answer, i’m going to check all that today and try. I will answer here after for the results !