@Damutantman
Yes indeed firing stops when the enemy is out of frustum, while 2.71 it fires all time.
Your example is very complicated, there may have many other possibilities than rayCast.
Is it use animation info to firing? Animations may really stop if its out of the camera.
I have feelings about next.
if not rig.isPlayingAction(5): #if the shooting animation isn’t currently playing
rig = own.scene.objects[childs[0].name]
if own['aim'] == 0:
rig.playAction("AimR", 0, 5)
own['aim'] = 1
if not rig.isPlayingAction(5): #if the shooting animation isn't currently playing
#I have an empty set where the barrel of the gun is, pointing in the direction that the bullet will travel.
barrel = rig.children['Player PB.001']
#extracting the bullet direction is a simple matter of using the orientation matrix. using .col lets us pull out the Z axis easily.
vec = barrel.worldOrientation.col[2]
#this is the position of the barrel of the gun
start = barrel.worldPosition
#and this is the position where the bullet will be at its maximum range. This setup uses hitscan, but it could easily be modified to use a bullet that takes a few frames to travel and is affected by physics. The laser pointer, however, would still want the "end" variable.
end = start + (vec * 100)
#print(str(end))
#print(str(start))
#now we check if the laser hits anything
#hit = o.rayCast(end, start)
#print(str(own['Target']))
hit = own.rayCast(end, start, 0, "maxhealth", 0, 1)
@Yamyam
Yes! The animation really counting wrong. It can really see if slow down to 1 fps.
frame counts 0,1,2,3,4,5,6,7,8,9,10,11,12,0 if buffers shadow exist (look like it goes one step over)
and 0,1,2,3,4,5,6,7,8,9,10,11,12 when no shadow.
EDIT:
It count one step over to zero with loop-stop mode too.
With (Resrict animation updates) activated seems work ok.