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.
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.
Ah, yes, making a scene component, making the sword the parent, and putting the scene compenent on the tip of the sword is a lot easier than trying to mess with pivot points.
Thank you CleanCut, youre right, my sword pivot is not on the rotation axis, there is no momentum, I mean the sword is more like rotating yes… Because of it is VR project I cant change sword pivot point, what if I create a new collider on the edge then take that one’s angular speed, do you think does it work? I will try…
Thank you… Let me try, If it is work I will close this question.