I adapted three identical models for list loading and defined a sequence of functions that move up and down, but when called again, only the last call will be performed and other objects will disappear. Why is that?
codemao = []
for i in range(-350, 450, 300):
coden= loader.loadModel('codemao')
coden.setPos(i, 0, 0)
coden.reparentTo(render)
cnodePath = coden.attachNewNode(CollisionNode('cnode'))
cnodePath.node().addSolid(CollisionSphere(0, 0, 110, 50))
cnodePath.node().setIntoCollideMask(BitMask32.bit(1))
cnodePath.node().setTag('codemaol', '1')
codemao.append(coden)
myTraverser = CollisionTraverser()
pq = CollisionHandlerQueue()
chuiPath = chui.attachNewNode(CollisionNode('chui'))
chuiPath.node().addSolid(CollisionSphere(-120, 0, 250, 50))
chuiPath.node().setIntoCollideMask(BitMask32.bit(1))
myTraverser.addCollider(chuiPath,pq)
pickerRay = CollisionRay()
def change(coden):
print(coden)
a = random.uniform(1,2)
b = random.uniform(0.2, 0.5)
c = random.uniform(1, 2)
d = random.uniform(0.1, 0.8)
yundong = coden.posInterval(a, (coden.getX(), coden.getY(), coden.getZ()), (coden.getX(), coden.getY(), coden.getZ()-180))
yundong_1 = coden.posInterval(b,(coden.getX(), coden.getY(), coden.getZ()-180), (coden.getX(), coden.getY(), coden.getZ()))
mySequence = Sequence(yundong, Wait(c), yundong_1, Wait(d), name="Sequence_%s"%coden).loop()
change(codemao[1])
change(codemao[0])