Hey!
So, I have an animated, simple crowbar model. When I press left mouse button, you can see that I can hit things with crowbar. But, the problem here is the force.
The barrel “weights” 200 kg, but after hitting this object with a crowbar, object flies as if I hit this with a car at high speed.
The thing is, I don’t really know how I could change that. If this barrel weights 200 kg, it should stay in the same place when hitted with crowbar, maybe “wiggle” a bit.
What I can do? Should I set the weight to some big number (for example, 5000 kg?), won’t it be a problem later?
Edit: This red sphere is a collider. It turns on when “attack” animation starts, and turns off when it hit’s something, so I won’t get a lot of “On Component Hit” calls in my Blueprint.
Understood, I suspected that. Since you are using a blocking object and the animation is too fast the end result is like that.
Couple of ways to overcome this even make it better.
First thing you can try lowering the animation speed and decrease the mass of hitting object.
A better way to do it is below.
Set your collision channel ( RedSphere) → OverlapAll
Create event on your blueprint OnBeginOverlap by clicking the collision component
Add force manually.
This way you can do many more things like, if its an enemy you can add damage etc. There is more ways to do it depending on the design you want to nail down. Like spawning force field, tracing objects and manually doing physics interactions.
is to trace things in front of you and do gameplay if there is an hit event, detect what is hit etc, generally this is more usefull however in melee combat if you are going to add slashes etc in future which you will go with 2nd one.