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"

Hit events no velocity?

I've been trying to set up a player that bounces by launching the character when they hit a surface, however I have run into many problems, the main one being that when using Event Hit or Component Hit events the velocity is always at zero, and not only this, but also when using a sphere trace to try and skip this issue (instead of event hit) and despite having frame rates of 144+ it constantly seems to calculate the traces after the physics tick, and so, despite having a larger trace then collision component, the velocity returns as zero. This is really annoying and will stop me from entering the concurrent Ludum Dare, so I would very much like to know the solution, or have the issue fixed in future please.

Product Version: UE 4.10
more ▼

asked Dec 13 '15 at 06:20 AM in Bug Reports

avatar image

Oscar Cooke-Abbott
542 54 59 71

avatar image getnamo Dec 13 '15 at 02:05 PM

You could try to store the character velocity as a parameter which you update every tick and then you can query it when the hit event happens and use your velocity vector to determine the 'reflection' velocity vector you would need to bounce around. Then it's a matter of setting your pawn velocity to the reflection vector.

avatar image Oscar Cooke-Abbott Dec 13 '15 at 02:14 PM

i tried that, but even 3 frames before the hit event is called the velocity is at zero - when the strange physics does occur of course, otherwise it works fine

avatar image getnamo Dec 13 '15 at 02:32 PM

Sounds like the order things are happening is causing the issue. You could try to use a bigger trigger object attached to your character so you can sample the velocity earlier? Sample it when that outer trigger object gets hit and OnBeginOverlap-> store the velocity then on Hit use that velocity to calculate bounce.

avatar image Oscar Cooke-Abbott Dec 13 '15 at 03:53 PM

As I said I've tried a really huge physics trace and also tried a large overlap component but this only makes the problem less consistent - doesn't eliminate it entirely, even with over 100% extra size for overlap

avatar image Adam Davis STAFF Dec 14 '15 at 07:36 PM

Hi Oscar,

Can you post a screenshot of your blueprint setup, specifically how are you calculating the velocity change when the object hits another object?

avatar image Oscar Cooke-Abbott Dec 16 '15 at 02:32 AM

In this image I am using a sphere trace with a HUGE radius - about 2x the radius of the actual colliding capsule of the character, as I said I have tried just using event hit (as you can see) and an overlapping capsule using the OverlapEvent - Event hit always returns velocity as zero, even though it shouldn't, and BeginOverlap yields the same occasional failing as the sphere trace in this image.

alt text

avatar image Adam Davis STAFF Dec 16 '15 at 02:59 PM

I just checked on my end and the get velocity node seems to be working as intended. Check your Y value to see if it is picking up any movement. Have you tried this in a clean, blank project with no additional content.

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

1 answer: sort voted first

Hi Oscar Cooke-Abbott,

We have not heard from you in several days. I am marking this as answered for tracking purposes, if you are still experiencing this error, please comment with the requested information.

more ▼

answered Dec 21 '15 at 02:45 PM

(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