Hi i continue doing the game. the problem i have is to move an object in periods of time, i tried to different ways to do this, i dont have error codes in the console, but it doesnt move. can you help me plz? heres my code.
linea1 = obl["OBPlane.002"] #the object i want to move
if temporizador.Text == "4:30": #when the timer gives this time
linea1.LocZ += 1 #the object will move
linea1 = obl["OBPlane.002"] #the object i want to move
if temporizador.Text == "4:30": #when the timer gives this time
pos = linea1.getPosition() #i get the position of the object
linea1.setPosition([pos[0], pos[1], pos[2]+1]) # i move the object
I have another problem, I wanted to make it so that every certain period of time the bullseye would appear and disappear. I implemented a similar code to the one from before, and in the object I put the visible actuator instead of the motion actuator. The problem now is that the bullseye disappears but the bullet holes remain, so I want them to go as well. Here’s a piece of my code.
newobj = acto_aniade_bala.getLastCreatedObject()
if obj.ebhole and ray_sensor.isPositive():
hit_pos = ray_sensor.getHitPosition()
hit_norm = ray_sensor.getHitNormal()
objeto=ray_sensor.getHitObject()
newobj.setOrientation(MAT_trackvector(hit_norm, [0.0,0.0,1.0]))
newobj.setPosition(hit_pos)
newobj.setParent(linea) #the parent is the bull
obj.ebhole = 0
#intermitencia
tiempo1 = minutos == 0 and segundos == 30
tiempo2 = minutos == 0 and segundos == 25
tiempo3 = minutos == 0 and segundos == 20
tiempo4 = minutos == 0 and segundos == 15
tiempo5 = minutos == 0 and segundos == 10
tiempo6 = minutos == 0 and segundos == 5
if tiempo1 or tiempo3 or tiempo5:
linea1.visible = False
elif tiempo2 or tiempo4 or tiempo6:
linea1.visible = True
and the controls are
I used the children option because, in theory, if the parent goes invisible, the children will do so recursively, but it doesn’t work. What am I doing wrong?