Hi everyone,
My game is ALMOST finish hehehe. But right now I have a strange bug!
When my enemy receive some hit, the enemy become invisible for a couple of time and become visible again after a while.
Here is the interval that do the job:
self.hideModelIntervalboss = LerpColorScaleInterval(self.boss1, 0.2, Vec4(0,0,0,0), Vec4(1,1,1,1))
self.showModelIntervalboss = LerpColorScaleInterval(self.boss1, 0.2, Vec4(1,1,1,1), Vec4(0,0,0,0))
self.invisibleAttack = Sequence(self.hideModelIntervalboss,
Wait(0.4),
self.showModelIntervalboss,
name="invisible Attack")
It work perfectly! The problem is that the planet that the enemy is orbiting around that also use transparency (for the clouds) became invisible too, at the same time…
Here is the code for the planet and the clouds:
#About the planet
#=======================================================================
self.root_planet = self.dummyAmbiant.attachNewNode('root_planet')
self.root_planet.setPos(0,0,0)
#load the BIG planet that we are orbiting around
self.mainplanet = loader.loadModel("models/planet/sphere-highpoly.egg")
self.mainplanet_tex = loader.loadTexture("models/MarsMap_2500x1250.jpg")
self.mainplanet.setTexture(self.mainplanet_tex, 1)
self.mainplanet.setScale(20)
self.mainplanet.reparentTo(self.root_planet)
self.mainplanet.setPos(0, 0, 0)
#add transparency
self.nuage = loader.loadModel("models/planet/sphere-highpoly.egg");
self.nuage_tex = loader.loadTexture("models/EarthClouds_2500x1250.jpg")
self.nuage.setTexture(self.nuage_tex, 1)
self.nuage.setScale(20.1)
self.nuage.setTransparency(TransparencyAttrib.MAlpha)
self.nuage.setAlphaScale(0.3)
self.nuage.reparentTo(self.root_planet)
self.nuage.setPos(0, 0, 0)
Am I missing something? They are completly independant node so it’s impossible that my transparency transformation on the enemy can impact the planet. I don’t understand…
Thanks!
Jaff