Hi,
how can I calculate the distance to the crossing of 2 lines (Line Trace)?
hi,
in this pictures it looks like from actor to hit point
or do you mean where the two lines intersect ?
cheers
to the intersection of the two lines
ok,
i do not know if there is a build in node for that, you could recreate the calculation and make it it´s own function. in unity i made the same and it worked perfect
i am making dinner right now, be back in 30 mins ~
cheers
how can this now be implemented in blueprint?
you have two actors and one shared hit location?
Ok, first trace with one actor (no need to trace both as you want the same hit result)
then you have location of actor 2 and you want distance from actor 2 to hit location.
then do this: length((hit location) - (actor2 location)) that would give the distance from hit and actor 2
what I mean is: you just need 3 points in space:
1 - loc of actor1
2 - loc of actor 2
3 - the hit results of line trace (from one of the actors)
the distance from 2 points is the vector length of the subtraction of the vectors
thank you very much for the answer. I don’t want to find out the location of the actors, but the meeting point of the 2 lines
you want the meeting point or the distance?
the distance of the meeting point from the two lines
ok then the solution is what I said previously.
is not clear what you mean with meeting point…why you have two line traces?
the problem you expose is have 3 points and get the distance from two of them.
in your picture you assume both ‘traces’ meet in on point. then why you need both traces?..if you do one trace and get a hit results then you have the point you need.
that’s exactly how I want it
C is unknown
do the lines intersect every time ? if not you need first to know if a intersection happens
your problem is not clear.
want to get this ONLY when both traces meet the same point??
then do both traces, then if you get BOTH hits, subtract hits results (you will get
a distance of both hits (threshold?) then if that distance is < the tolerable ratio you
want to assume they hit almost same place then you do the math between HIT and actor C pos.
so:
1 get both traces
2 if you get both hits and distance tolerance between is ok then:
3 average both hits distance and get distance from that point to actor 2
the lines do not intersect, otherwise the two lines would have turned green after impact
i mean are these imaginary lines so to speak ? with no clear hit point ?
It is a line vin Line Trace by Channel