Hey all, this might be a noobish question, but here it goes. I’m in a team making a game in which you collect creatures, which then follow behind you. Before we had animations done, i simply took the model and reparented it to the main player which would make it autofollow. However, now with animations and the other characters being actors, I am having trouble searching the array for the correct character upon collision. Here’s my declaration code:
for i in range(4): #change to number of fish in the level
fishie = Actor('FishModelTest/FishA5', {'walk': 'FishModelTest/FishAnim1'})
#fishie =loader.loadModel("FishModelTest/FishA5")
...
...
fishie.reparentTo(render)
self.theSchool.append(fishie)
then upon a collision, with models I used to be able to do this and get the index in the array of that model:
theIndex = self.theSchool.index(cEntry.getIntoNodePath().getParent())
self.theSchool[theIndex].getChild(1).detachNode()
self.theSchool[theIndex].reparentTo(self.temp.getChild(0))
however, this code does not work the same with actors as they are never found in the array. How would I go about fixing this so that the code can work with actors?