Thank you for the in depth response. Not really sure what I mean by “blocking” either, I don’t understand the physics engine at all and am regurgitating what I’ve heard other people say in the hopes I get corrected lol. Finding the terminology you need to be searching for is the most simple, yet hardest part of game dev.
Heres the script, apologies for the visual scripting, I’m a blueprints pleb that needed to make a quick transition to unity for a school project
In this first image is where the event is called, the point is set to the position of the object, radius to the range, which in this case is 7, and layer mask to 6.
I originally used an oncollisionenter event combined with a circle collider to detect enemies, but that didn’t work if an enemy was already inside the collision circle when this state in the state machine was entered, and oncollisionstay was not calling for some reason.
I’ve seen another post in the meantime suggesting that turning on Auto Sync Transforms would fix this particular issue, however it ended up breaking all of my colliders, not sure why, I don’t understand the magic behind the physics engine. I’ve also seen (I believe in one of your posts) that you should not drive physics objects by changing the transform, however this is attached to a nav mesh agent and that is unavoidable.
Here is what is happening in the scene. The circle collider on the character to the bottom right is set on begin play to the same variable that is setting the radius of the overlap circle. So it should be not only detecting the little box collider on the upper left, but also the circle collider I was using for oncollisionenter. However the return array length is still 0 as you can see in the first screenshot which was taken while paused at the same time.
In this third image you can see that the box collider is set to layer 6
And finally, here is the components and settings for the CollisionBox object.
Thank you for your time and patience
- I just noticed the box collider wasn’t set to trigger, perhaps I did just have blinders on from staring at it too long, lemme see if it works
**Didn’t change anything, I guess the circle collider would have been picked up if that was the issue since it was set to trigger.