How to see the hit location of a line trace?

Question is simple, how can I see or calcute the hit location of a line trace? Like world location. Also I want to calculate (or see) the inclination of the hit location of line trace. Think of it like a perfectly bouncy bullet hits a wall and has to bounce off perfectly, how can I get this in that regard?

In the OutHit struct ImpactPoint is the hit location of the trace.

Try this:

2 Likes

Thank you man :slight_smile: One more think seems like you could help me again, how can I get the middle point of impact and reflection in that regard? Like:

That would be the ImpactNormal.

2 Likes

How can I get it detect when the distance of hit, and inclination of hit point (impact normal)changes? Like how can I get these changings into an input, or use it like a trigger to start a line of nodes?

For this you’ll probably need to store both the hit distance and the trace direction so you can compare them over time.

For distance, you can do something like: abs(CurrentDistance - PreviousDistance) > Threshold to detect changes larger than a certain value.

For direction, compare the normals with a dot product: dot(Vector1, Vector2) < cos(MaxAngleDifference) to detect when the surface angle has changed enough.

I could help more if you can explain a bit how the whole system is supposed to work.

1 Like

The concept is kinda unique and surreal, to put it simply in that regard, we can say the character sometimes will move along some 2 directional, not completely flat (its comppletely flat in some places) surfaces, and when it does the character will rotate itself to the point normal of line trace hit. Yes this is pretty much it, but I don’t want that system to be work all the time, I want it to detech when there must be a change, therefore it will only be triggered when the line trace cutting distance is noticably changed.

Also, for an another line trace in same character, the character must move to world location of line trace hit point, and it must move wiht a certain speed like 3 meters per seconds.

I am a newbie here, I don’t know the right nodes and everything. Mabe I am making some mistakes somewhere in the system. Regardless, I can’t even build the bp anyway :DD

Can I do these set and compare of current and previous distances almost at the same time like just lining the nodes the same way, or I must add delay or something? Because I thing mabe it would not work perfectly if we both set and compare the variables at the exact (or almost exact) same time.

The compare should happen first, then the set. It’s ok if it checks every frame so don’t worry about that while setting it up.

i can share later a bp of how the math would work.

1 Like