If anyone's really interested: Here's my preferred method: What you need: (set all three of these to a physics layer where they can collide with only themselves:) +An Area Node - stuck on a player/rigidbody +6 RayCast Nodes -also stuck to a player/rigidbody pointing out in all 6 axes for a mile or two +Your Custom Shape on a Static body
The important lines of code: on the player:
onready var checkaxis = $Area/CollisionShape.getchildren() #I placed the RayCasts under here for my player just cause...
func ready():
for rays in checkaxis:
rays.setphysicsprocess(false) #I really have a feeling that they take up too much processing power when they're on
func isinside():
for x in range(5):
if(checkaxis[x].getcollider() != null):
if(checkaxis[x].getcollider() == checkaxis[x+1].get_collider()):
continue
else:
return false
else:
return false
return true
func onAreabodyentered(body):
for rays in checkaxis:
rays.setphysicsprocess(true)
rays.setphysicsprocess(false) #luckily RayCasts apparently can remember the last thing they hit even when their physicsprocess is off
func onAreabodyexited(body):
if(is_inside()):
prints(self.name,"is inside:",body.name)
else:
prints(self.name,"is outside:",body.name)
The closest thing you can have as a custom collision shape for an Area Node is a convex collision shape generated from a mesh but sometimes they might not be in the "shape" you want them to be. They usually end up as a pile of CollisionShape Nodes of irregular shapes with gaps in between, giving inconsistent PhysicsBody detection.
This method allows you to use precise custom collision shapes as detection "areas". Instead of using an Area Node with janky generated convex collision shapes to sit and wait for a PhysicsBody to trigger a response, we use a StaticBody holding the precise custom collision shape to sit and wait for an Area Node attached to a player to trigger a response.