• News

• Industries

• Learning & Support

• Community

• Marketplace

# Break Hit Result explained

Hi,I don’t understand a few things about the break hit result node. Can someone help me figure it out?
The nodes I’m not sure about are: Time - can someone please explain? Location - as I understand its the position the colliding object has to be in order to collide with the other object but not penetrate it, correct?
Normal - the normal of the surface that my object collides with, correct? Impact point - as I understand its the exact point where the two objects touch, so its on the surface of the two touching polygons, right?
Impact Normal - not sure about this one, how is it different than the other Normal vector?

I really appreciate if someone can explain these to me.

The time node there is the percentage length that the trace had to travel before hitting something. Which is normalized to stay between 0 and 1. So if your trace hits something that’s covered 40% of the maximum distance your trace runs for, you’ll get a value of 0.4.

On this image of a capsule trace the blue dot is the location.
Red dot is the impact location.
Pink line is the impact normal.

The normal is the direction of the target object’s center point towards the hitting object’s center point. (This is only the case when there’s objects hitting each other, for traces it seems to be the same as impact normal all the time. If that was a capsule object hitting the cube, the normal would be pointing to the top left’ish)
The impact normal is the normal of the surface where the impact happened.

Thanks for the explanation, I’m still not sure what you mean by the length of the trace and its coverage, can you please elaborate on this matter? maybe using that diagram you gave?
Thanks

If you think of the trace line as a scalar value that goes from 0 at the left to 1 at the right. Then as the trace moves from left to right it will keep increasing in value until it hits something. On the picture, the red line is about 30% of the length of the entire line or 0.3 (30%/100) of the way there and that’s the value you get from the Time node.

If the end of the line (green capsule) was much much farther away to the right, then the red line would make up a smaller fraction of the entire length and you would get a smaller value, even though the length of the red line did not change.

I’m not sure what the trace line and the green capsule represents…

The line is the center point along which the capsule moves. It has a beginning and an end. It also has a direction, in this case it moves from left to right.

In this image, the capsule moves uphill until it gets to 0.3 and something blocks it. Then it draws the red capsule and gives you all the information about the hit locations and normals.

If your hit was near the yellow (hand-drawn) capsule, then your Time value would be 0.75.

The green capsule is the last position it tries to detect collisions in. If there were no collisions before reaching that point, it would not make any hits. Even if there was an object to the right of the green capsule, it would not try to hit it, because it is out of range, it is too far away, it doesn’t care about things that are so far away.

Thanks for taking the time to explain this to me, it really helps a lot.
I have two more questions regarding this scenario (I hope I can phrase it so it would be clear enough):
1.Is the end position (green capsule) the place where the capsule would be if it hadn’t hit the wall at the time that the event was fired?
what I’m trying to ask is, if the event is fired at the exact time that the collision happens or it detects it a few miliseconds afterward and at then corrects the position of the capsule to where its at in 0.3 time.
2.So what what time is the start time? is that the time of the last tick or something like that?
Because in my scenario the object is a pawn and it changes position according to user input so there’s no predefined start and end to its movement (its the spaceship from the flying template basically).

Again, I really appreciate your help with figuring this out.

Edit: also, what does it mean that if the time is 1 there is no hit? if there was no hit I shouldn’t get “Event Hit”.

anyone? I still don’t understand what the start and end point.

The start point is where it will start tracing from, the end point is where it will stop tracing.

Yeah, but lets say I got “Event Hit” in blueprints, does it mean that it did a trace and it figured out that it found a hit at 0.3 of the way but it didn’t hit yet?
so I get the “Event Hit” without it actually colliding? thats what I’m not getting.

No, Event Hit is completely unrelated to line tracing. Event Hit is when it collides with something, so if I shoot a bullet, the bullet BP will get an Event Hit when the bullet hits something. It only does a trace when you tell it to, so if I want to see if there is an object in front of me, I will ‘Line Trace by Channel’ in front of the player every frame, and then print string if the return value Boolean was true. Or if I want to randomly spawn lighting, but make it so that it hit’s the ground, I will line trace at the location of where I spawn the lightning, and line trace down, and the hit location will return the location of the ground.

Thanks, now its perfectly clear, in the example I was looking at the pulled a “Break Hit Result” out of an “Event Hit” node, so I guess when you do that the line trace doesn’t exist and Time is not relevant and is always 0 or 1 whatever the default value is.

Not to be a necromancer, but does green capsule mean anything besides showing end trace point ? (kind “green” - fits, “red” - doesn’t fit)

Never mind, it’s the end location.