We'll be using a LerpScaleInterval
, a Parallel
, and a Sequence
to create a script for when our machine gun lasers fire. Before we start making the MachineGun
class, though, our Cycle
class will need some small modifications.
Open
CycleClass_01.py
and add this line to our imports section:from GunClasses_01 import *
Scroll down to the
setupVarsNPs()
method and look for the lines where we callself.fd.reparentTo(fdMount)
andself.rd.reparentTo(rdMount)
. Right under those lines, add the following code:self.LMGMount = self.turretActor.exposeJoint(None, "modelRoot", "LMGMount") self.RMGMount = self.turretActor.exposeJoint(None, "modelRoot", "RMGMount") self.LMG = MachineGun(self, self.LMGMount) self.RMG = MachineGun(self, self.RMGMount)
We'll add a little bit of code to the
CycleControl()
method as well so we can actually shoot ourMachineGuns
to test them. Put the following code right below the section where...