how to convert velocity to damage(float)
Hi, I am using HTC vive VR, and my character has a sword. And there are enemies. I am trying to apply damage to enemies with sword. But I want to apply damage according to velocity of sword. I can access sword swing speed in blueprint, but I dont know how to convert it to float. Any help would be appreaciated. Thanks.
asked Jan 26 '17 at 07:22 AM in Blueprint Scripting
Using the length of the component velocity is the correct way to get the speed of the movement of the origin of the component.
Your problem is probably that the pivot of the component is not moving much, it's probably mostly rotating. There's no easy way to get the angular velocity of a general component that I'm aware of.
You might be able to work around it by moving the pivot point of the sword up to the tip of the sword. Then the component velocity would be the velocity that the tip is moving, which is probably the part of your sword that moves the most.
A more complete solution would be to track your own position and rotation each tick and manage your own calculation of momentum.
Follow this question
Once you sign in you will be able to subscribe for any updates here