Announcement

Collapse
No announcement yet.

Trace detect if hitting inside of collision mesh?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Trace detect if hitting inside of collision mesh?

    If I fire a trace from within a mesh with collision, it collides with the edge of the collision mesh. However I want to ignore if i hit the edge from inside the mesh (an only care if i hit the outside).

    The material applied is one-sided, so when inside the mesh, you cannot see the material. Is there a way to detect if the hit surface is visible or not?

    A good example of what i want is the Landscape (from beneath it, you can fire a weapon through it, but from above it will collide with the surface).
    Last edited by Coldscooter; 05-30-2019, 08:38 PM.

    #2
    I don't know if you can do exactly what you're trying to do, but maybe you can do a TraceActors instead. If you already know the thing you want to ignore, then if the trace hits the thing you want to ignore, do a "continue;" and then do whatever you want to happen to the next actor that gets traced, and then "break;"

    If that's not going to work, you can use the normal vector that gets returned on the trace. If (direction from target to the thing firing the trace) dot (normal of where the trace hits) < 0, then ignore it. But if you have any two-sided materials on polygons that you're supposed to see the back of, then this won't work.
    Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

    Comment

    Working...
    X