Is there some way to detect that we are currently inside complex collisions?

Initial overlap does not work. Normal overlap does not work as well. It just doesnt detect it.

As in: we are completely enveloped where the colliders boundaries do not intersect? And by Initial Overlap, do you mean Begin Play? Level Streaming? Begin Overlap?

1 Like

By intial overlap i mean the Hit result variable. And yes, we are inside an object with complex collision, lets imagine its a huge object and we are in it’s center, and our trace radius is too small to reach any collision triangle

1 Like

How are you obtaining the Hit Result in this instance? Begin Actor / Component Overlap? Some other way?

For my test i just perform traces every tick. It does not detect nothing when it’s completely inside complex collisions. As well as SphereOverlapComponents/Actors

Still vague and fuzzy. Any chance you could be specific? What are you doing, precisely, to detect it? There is at least a dozen ways to detect an overlap. This?

As well as SphereOverlapComponents/Actors

And when do you do it? Begin Play? I am grilling you because I am trying to figure out whether it’s this:

The option above it, too or something else.

Okay lets break it down.

First of all, i perform SphereTraceForObjects every TICK on some location (lets it be Loc).

When i move Loc inside simple collisions, hit result gives me InitialOverlap == true, and returns Normal + Penetration depth that i can use to get out of collisions.

When i move Loc inside complex collisions, it gives me InitialOverlap + Normal + PenetrationDepth ONLY if it actually touches these collision triangles (unlike simple collisions). It gives me nothing when it doesnt touch these triangles, so i am unable to move my object outside collisions.

Why is that a problem? Im using custom physics for some objects, it sometimes it has a pretty high speed, that leads to such result.

This image is taken from INSIDE tho

1 Like

it’s getting clearer. I mean, I’d hate to state the obvious but there are no triangles there to overlap. Unlike a simple collision, this is not a volume anymore.

  • we are moving fast
  • frame 1: trace on the left of the triangles
  • frame 2: trace on the right of the triangles

That’s the whole point of Sweep existing:

It will check the space in-between 2 locations. But even that will fail at great speeds and distances.

So there is actually no way to detect that we are now inside collisions? I gotta make my own solution on that?

It does not work for physics kinda. It sticks to collisions sometimes, leading to problems. You have to perform traces using NEXT location, without using previous at all

I believe so. Try setting a location of an actual sphere collider with Sweep enabled, just to test it:

It should :crossed_fingers: work better. But may not be ideal for many reasons.

the problem is that my custom simulated objects arent even actors, so im unable to test it out

FINAL ANSWER:

No, you cant simply detect that youre inside the complex collisions. Make your own solution

(im thinking of using a huge sphere trace multi right now, thats the first thing comes to mind.

Obv, you add it once and then set location every frame. Again, this is just to test it so you can start figurenig out how to work around the actual issue.

I see what are you trying to do, but its a bad idea to use a single trace from start to end like sweep does. Instead, its better to break it all down to smaller steps and perform multiple traces. Thats how CCD works as i know, thats what ill now implement i guess.

Why its a bad idea?

Even a tiny nanometer of collisions may stop the object from moving

1 Like

It’s a great idea when everything else fails. But yes, I very much do agree with you. It’s expensive.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.