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"

Setting Velocity Is Extremely Inconsistent

I have an enemy, when it dies I turn on Ragdoll so it slumps to the floor. But I wanted the added effect of adding velocity away from the player upon death, by a means of adding extra knock-back and force

However, the results are insanely inconsistent. Some times it slumps to the floor, other is flies off a thousand miles away in the blink of an eye.

I have tried using many adding force nodes for this and they all yield the same results. (Add Force, Set Velocity, Add Impulse, Launch Character).

I am Turning the Mesh into a Ragdoll, and launching the mesh itself. I have tried detaching it from the parent controller, so it is literally just a static mesh with rag-doll physics and nothing else. But I still get these poor and inconsistent results.

Any Tips?

Product Version: UE 4.19
Tags:
more ▼

asked Sep 14 '18 at 11:26 AM in Using UE4

avatar image

Raxs_Slayer
76 4 7 10

avatar image FelixTheWhale Sep 14 '18 at 12:12 PM

Hi, it is not the answer you expect because you need to find a source of this behavior. But there is a way you can minimize the effect:

  1. Add linear drag.

  2. Also you can clamp final velocity in "Event Tick" like this: this->SetComponentVelocity( GetComponentVelocity().GetClampedToMaxSize(float Your_Max_Velocity) )

Some ideas to find the reason: what about mass? Is it greater than 0? Additionally, try to turn on CCD in characters physics. Is it ok when you simulate ragdoll in physics asset tab?

avatar image Raxs_Slayer Sep 14 '18 at 04:28 PM

Hi Felix, Clamping the velocity seems like it would help, but I am not sure how to pull that off with blueprints. I tried the other things, and they help to a degree. So it's better than it was, but it's only masking the inconsistency. I've always had issues with Ue4 and changing velocity. I never had these kinds of issues with Unity. So I'm not sure why it's happening here.

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

2 answers: sort voted first

Okay, I seem to have found a solution after returning to the problem. Annoyingly, it seems the only thing I did wrong was use the wrong node. There are roughly 10 nodes in Ue4 all designed to add velocity to actors, and there aren't any real discernible differences between them all, except one; "Set All Physics Linear Velocity". This seems to be the only node that adds velocity reliably. All the others do the exact same; which is add velocity but do so with extreme inconsistency.

more ▼

answered Sep 14 '18 at 04:41 PM

avatar image

Raxs_Slayer
76 4 7 10

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

Hi, If you have death animations for the character you're working on, you can try playing those anims on death, and enabling ragdoll on OnBlendOut

It's the method I tried on the latest project I'm working on, and it does seem satisfactory, but not perfect.

more ▼

answered Sep 14 '18 at 12:48 PM

avatar image

DAVIANGT1
6 2

avatar image Raxs_Slayer Sep 14 '18 at 04:30 PM

Hi, sadly I don't have animations for deaths. The enemies in the game are spiders and are meant to be shunted away from the player when hit from a blast of a shotgun on death. The only way I can see that this will work is by adding force to the rag-doll bodies upon death.

(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