Hello, I’ve been working on a game project for my class and I’m supposed to detach an object’s node when it collides with a missile, however, I’m getting an error when Destroy Object is getting called and I’m not sure what is causing it. The error is: _error_type != et_not_found at line 668 of panda/src/pgraph/nodepath.cxx
The code for where the error occurs is:
def HandleInto(self, entry):
fromNode = entry.getFromNodePath().getName()
print("fromNode: " + fromNode)
intoNode = entry.getIntoNodePath().getName()
print("intoNode: " + intoNode)
intoPosition = Vec3(entry.getSurfacePoint(self.render))
tempVar = fromNode.split('_')
print("tempVar: " + str(tempVar))
shooter = tempVar[0]
print("Shooter: " + str(shooter))
tempVar = intoNode.split('-')
print("tempVar1: " + str(tempVar))
tempVar = intoNode.split('_')
print('tempVar2: ' + str(tempVar))
victim = tempVar[0]
print("Victim: " + str(victim))
strippedString = re.sub(r'[0-9]', '', victim)
if 'Drone' in strippedString or 'Planet' in strippedString or 'SpaceStation' in strippedString:
print(victim, ' hit at ', intoPosition)
self.DestroyObject(victim, intoPosition)
if shooter in Missile.Intervals:
Missile.Intervals[shooter].finish()
elif shooter in LargeMissile.AltIntervals:
print(victim, " hit at", intoPosition)
self.AltDestroyObject(victim, intoPosition)
print(shooter + ' is done.')
def DestroyObject(self, hitID, hitPosition):
nodeID = self.render.find(hitID)
nodeID.detachNode()
self.setParticles()
self.explodeNode.setPos(hitPosition)
self.Explode()
I also have my github for the project public if the full code is needed to be seen: