Detecting if ray is touching certain ray

hello so, i am making a stand game… basically theres this feature where they can punch really fast and its called a “rush” and i want to simulate it. heres what it look like when their rush clashing (when 2 people are using rush it makes a rush clash)

so in my game i have a rush animation and all that, and i use raycasting for hitbox on the rush. i am wondering how to detect if this certain ray (cause theres other rays used) touches another, and if you guys know any better way to do this please tell me.

You can’t check if two rays will intersect. Rays fire one at a time unless on separate threads. But they still won’t collide with each other because they don’t function that way.

You could get both start positions and directions of the rays and work with a bit of math to check if they would intersect or not. Shouldn’t be too complex since they’re moving in a single direction and in a straight line. You may have to search for “2 objects will collide algorithm” on Google. Something along the lines of that.

well the thing is people aren’t entitled to be next to someone; its like if 1 person rushes, and then another person comes up to them and rushes it will make some shockwaves and stuff, if one of them walks away then the shockwaves will go away. i don’t think that’d be possible with the method you suggested?

Thats not impossiblesomewhat however, this method might not be recommended of course.

Create your raycasts as per usual, summon a part that only those raycasts can hit.
Attach the part to the end of the raycast or start/origin.

If either raycasts hit those points, you can think of it as a raycast hitting another raycast, hacky but may work?

However, I dont know about the performance.

If you want it to do randomly, you can just have a bool check in both characters if they’re rushing, and do math.random to take damage :man_shrugging:

hmm seems like a good idea; i’ll try it and say my results

okay i have done this and it helps!!! thank you i will tell you if i have any further problems with this method