Hello,
I wanted to ask if it is possible to adapt the Physics.overlapbox to the box collider of a game object? The background is that I have a game character in my project that swings an axe and is supposed to hit a tree with it. With each hit, the tree should be damaged until it falls over. Now I’m wondering if it’s not possible to simply attach an invisible cube to my axe and somehow say that this cube is the overlapbox. And every time an object called a tree enters the overlapbox, the tree receives damage?
Would be really grateful for help.
Are you aware that Physics.OverlapBox is just that, you’re just asking what this “invisible box” overlaps. You don’t need to attach anything to use it.
Maybe you’re indirectly asking how to visualise the arguments you pass to OverlapBox but that’s not really a physics question.
You can use Gizmos.DrawCube to visualise the position, size, rotation properties on your script of a virtual box.
1 Like