Let’s say I have a dummy behind a wall, and an explosion on the opposite side of this wall.
If I were to cast a ray from where the explosion happened, and the left arm’s position, it would look like this:
Even though, from the perspective of the explosion, there’s clearly some left arm sticking out from the wall.
And that’s my problem. I want to make sure a part is completely behind a part, and if there’s some amount of part sticking out, to damage the dummy.
This is pretty hard to do, but I guess there is a few ways to go about it. For example, the first way and arguably the easiest would be to get the furthest part of the arm, i.e the top of the hand, and check that parts Z co-ordinate vs the parts co-ordinate. and subtracting them, and then checking them by half the parts length ((part.Z - finalArmPosition.Z) - part.Size.Z/2)
, however this is scuffed, wont work 100% of the time and only works with the original part.
Another, harder way of going about this would be to cast rays at all directions along the part, and then simulating more rays from the edge. This would be more expensive however the result you’d get would be a lot cleaner.
1 Like
Not a bad idea. I could get a few positions with the arm’s LookVector, UpVector, and RightVector.