eldany.uy solution should work fine
and you can choose the threshold.
eldany.uy solution should work fine
and you can choose the threshold.
I’m really confused now. Why 2 “Line Trace by Channel” in one actor? there are 2 different actors. In each actor there should only be 1 line trace by channel
this will work as long as your two actors hit the same or almost the same place. or do you mean something like this ?
both do line trace and hit the wall but the intersection is somewhere else ?
If I were you, I will solve it using simple algebra (find two vectors intersection):-
ok then is best like Syed suggested too to calculate it via algebra. in the videos above the calculation is explained, just throw in the values and make it without z axis. you could take the median point later if you so prefer.
other question, needs it be in 3d space (exact overlap in xyz) or just from top down (xy)?
just from top down
ok,
i try making a quick example… can take up to 30 mins, have too look after the kids first
Thank you so much!
ok,
we will make kakao and then go to sleep
only one more thing, so you said without walls, then it could be that the line trace did not hit anything? so it´s at its max distance but has not found a suitable target for its hit ?
yes
ok now i get it
a few minutes, then i open the editor
ok sry took a while, back with some example soon
i am so sry, all kids are awake now and i do not have time atm, ill promise you i post i later… in max 1 hour is bed time
cheers
hi,
sorry for late reply but here it comes ^^
(edited a few times, images are below to download, you cant see much on some)
a quick overview before we start…
ok lets do it
lets start with the line tracers…
this is your actor who fires a line trace. note the actor has an variable called ID, which is a simple INT. ATM there are only 2 IDs available, 0 and 1 but you can expand as you like.
this has the purpose to save the values for the marker, you could just fire the LineIntersect function when you know your 2 lines.
if you do not want intersections happen if something was hit, change the line trace from trace end to impact point.
here in my Gamestate (you could put it somewhere else) i made this function to store the lines so i can get my marker to show up. this is not required. it has the LineIntersections variable which is an Vector Array with 4 entries (line a start, line a end, line b start, line b end) and LineIntersectionX which is simply a Actor for the marker like in the pictures.
ok lets start with the main actor
this is a function library, so we can access this function globally.
the local variables are needed for calculation, i mean you can let them out but then you will end up in spagetti nightmares
ok here is the function, i made it out of several pictures, it wont fit on one screen to read…
please excuse the guerilla style snipped here ^^
this is the main function for intersection 2 lines. i made the same in unity but here i used an other algorithm, it is based on an algorithm in Andre LeMothe’s “Tricks of the Windows Game Programming Gurus”.
hope this points you in the right direction, z i the average point ATM but this can be tweaked
i hope this helps you out, would be better to make a c++ function but by the time i have not setup everything to do so…
cheers
here are the images in rar
images.rar (3.5 MB)
i see there is a problem with larger images, they get scaled and you cant see anything
It’s an incredible solution! Thank you for taking so much time for me!
Please mark his post as the answer… yeah kudos to him…