x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.14
Tags:
more ▼

asked Jan 26 '17 at 07:22 AM in Blueprint Scripting

avatar image

mahlukat
19 6 9 9

avatar image mahlukat Jan 26 '17 at 08:55 AM

I tried with get component velocity as I've seen from other questions, but it doesnt work.

alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jan 26 '17 at 07:18 PM

avatar image

CleanCut
2.1k 67 84 77

avatar image mahlukat Jan 26 '17 at 07:52 PM

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...

avatar image CleanCut Jan 26 '17 at 08:03 PM

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.

avatar image mahlukat Jan 26 '17 at 08:06 PM

Thank you... Let me try, If it is work I will close this question.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question