So I have three characters in my game. One of them has the ability to carry the other two characters on his back.
I want this to happen by having the Carrier walk to up another character, press a keyboard button and then have the other character get ‘attached’ on his back. See wonderful drawing for visualisation:
This is what I have so far. But for some reason, now nothing happens; the Carrier just bumps into the Child and doesn’t pick it up. What am I doing wrong?
NOTE: I used this exact setup for another instance where a character needs to pick up a key by walking up to it and it worked. That’s why for now I used this same setup to test out if the same logic would work here, but ideally I want my blueprint to also include a “press whatever key” event.
You must change the movement mode of the carried character to Flying so it won’t go in the Walking code.
You may also disable collisions on the carried character capsule.
You cannot use the Character capsule overlap because engine physic code will prevent overlapping between several pawns.
Add a Sphere shape to the carrier with a larger radius than the physic one (let’s say 2 or 3 cm larger than the capsule), then set its collision to custom and all responses to ignore and but keep “overlap” on the pawn channel.
Then connect your BP code to the new shape overlaps events.
The Capsule of the carried should follow the carrier with the attachment code you gave.
Anyway you can call SetActorEnableCollision(false) when picked up and SetActorEnableCollision(true) when released, it should prevent every collision issues
Hi, sorry to bother you again. So your method works, but I noticed that once a Child is picked up, its Capsule Component remains at the location of pickup. The Carrier is blocked by this invisible capsule. How can I resolve this?