What causes picked up ( and attached) weapons to slowly start drifting from socket position?

In this video of a Beat Em Up style template, the TPC picks up a bat, and you can see the bat slowly starts moving away in what looks to be Y+. I currently have that if the player is attacked and has a weapon they “drop” the weapon and it appears on the ground next to their position. But with this drifting / sliding thing,I found that even after detached from the player the bat slides on the ground Y+.

Has anyone encounted this effect with attached objects? If so how to fix it?

@Everynone could you check this out and give me your opinion. Thanks all.

1 Like

I also tried just using the r_hand default socket and the problem remained, leading me to wonder if it is something to do with the mesh somehow.

New mesh, new blueprint, and it is still doing it!

I did notice something though, after the player is knocked down and the weapon is beside him it still slides on the ground until another third person character is spawned.

Help!

Looks like a root motion issue.

1 Like

But I thought root motion only applied to animations? But I’m interested to hear your idea, how do you think root motion could effect this attached actor here?

bump

It just something that can happen. I depends on the animation. It’s kinda a glitch. It looks like you might have moved the root of the skeleton during the animation. Then you moved it back to its original position. With frame updates and parenting the object to a socket or position, It’s possible that any root movement can cause what you’re seeing. The parent position has to calculate first to give the child the position it needs to be in. There’s so many options with animation in Unreal. I’d go to the animation, check the root, when it’s updating, and work my way out. Sometimes I go into the engine and try to reproduce the error so I know how to fix it (if I even can fix it). I’m not off work today, but I liked the old school type appeal/style you have going so I threw 2 cents. Real sorry about that.

1 Like

Is physics enabled on the weapon?

1 Like

No, I tried again just an actor BP, a static mesh is the root set to custom and overlap all, and a collision box below the static mesh, also set to custom and to overlap all just so the player can pick it up.

Any insight is appreciated, thank you.

Thanks for checking out this thread and situation. Oh man, I may have moved the skeleton accidentally or on purpose even (the uppercut animation had to be moved considerably). Is there a way to make the skeleton default back to the factory settings?

bump

bump

Think you should share a project with the issue.

1 Like

Disable all collision on the picked up item that blocks PAWN and the Capsule.

Server needs to pickup and attach the item.

Item needs to be set as replicated.

1 Like

The project is not ready for a public release, but I appreciate your interest in the project.

There is nothing here that should be blocking the player. The basebatactor bp is just a static mesh as the root, and a box collision attached to that, and in both its set to overlap all.

The object type is set to “weapons”, a collision preset I set overlap all by default. On the third person character, there is nothing set to block that weapons channel.

Ok the server needs to pickup and attach the item, and the items replicated, I will keep that in mind but have not gotten to multiplayer yet. Thanks for your input.

Ok back to the drawing board… Trying to do what a few forum members suggested in this thread, and that is to actually place as much of the logic as possible inside the weapon’s own blueprint(s) for increased efficiency / functionality.

This time will try the knife instead of the bat. Made an actor bp called it “KnifeActor”. An put the following code in the event graph.

Right clicked on the box collision and added an “OnComponentBeginOverlap”, then casted to the third person character. Then I checked if face button left on the gamepad was being pressed. If true I attached actor. Set socked to “knifesocket”

Played the montage “pickupmontage” and added a delay for the whole animation time, disabled input between the montage and the delay. Set my “Has Weapon?” boolean from TPC. Also set my weapon enum from TPC to knife. Reanabled my input.

Here is the result -

It seems now the weapon is attaching and is no longer drifting, BUT(always a big but right?), it seems the socket is being totally ignored to place the weapon about midways into the TPC.

Can anyone explain this? thanks!

Success!!!

I changed out the “attach actor to actor” node for a “attach actor to component” node. And got the mesh from the TPC cast and connected that instead.

Also had to get different game state refs as I was receiving an error.

Although I can get back to working on the template, the problem still remains unanswered and perhaps I should leave this thread open as I did not find the same problem out there in the interwebs.

Not your project… an empty project only with the actor that drifts.

2 Likes