attach dart and pin character to wall

Hi,

I’m creating a dart trap/pressure plate system with projectile movement where you step on a plate and it fires a series of darts. The darts fire correctly but when they attach with the player they don’t attach to the correct socket and sometimes disappear entirely. The print string also returns none most of the time

My goal is to

  1. fire the dart
  2. When colliding with character, attach to the hit bone
  3. push character until dart hits a wall
  4. character and dart stuck to wall and then character dies

I’m using a component hit event and passing the nodes into my function below
image

Hi,

Maybe the collision is happening for something other than your character - maybe a collision capsule or something? You could add a printstring to display the Hit Actor.

tried that aswell, returns the character, definitely hitting them

what about the Hit Component - is that the skeletal mesh component?

it returns the dart BP and SM like this
image

OK - that’s not in your character BP right?

You can use the node below to find the bone from your character BP with something like
image

still the same problem sadly, it seems to be attaching way up above the character, I only noticed that because of the shadow from the dart

This is how I’m spawning it from the pressure plate, all hit logic is inside BP_Dart
image

hmm - in your AttachToComponent try changing the Location Rule to “Snap to Target” or “Keep World”

ok I changed both Location and Rotation to Snap to world and now it seems to attach to the correct area. Only problem is when it hits the player the projectile just stops. All I changed was this to make it snap correctly and I change the attach to Actor to Component

It’s probably stopping the physics on the projectile when you attach the dart to the player.

Doesn’t seem to matter what I change, when it hits the player it stops the projectile entirely even when all the nodes are disconnected or eve when the hit event is removed

It sounds like you’ll need to ensure the projectile doesn’t actually hit the character (turn off blocking for everything except a custom trace channel maybe)

ok, what I ended up doing was removing most of the collision on the dart itself and just added another collision sphere on-top and that seems to do mostly what I’m looking for, however still some issues here.

For some reason, the dart loses all velocity on hit, still not entirely sure why but this is my workaround for that

for the Dart itself I’m only checking collision for WorldStatic

On the collision I check for anything non-static

I swap the camera when we successfully attach the dart to player

My main problem now is that sometimes the darts will not attach to the player and secondly the player most of the time goes through the wall like this vid, any suggestions for these? :sweat_smile:

yeah - multiple levels of collision can get interesting!
Maybe a work-around would be to move the collision sphere back a bit once the player and darts are attached?