Hello people.
I am trying to execute an Action inside an ‘if’ block but it is not working. And there is no error on the console.
If I put the execution line outside the ‘if’ block it works normally.
Could someone explain to me why the same code is not working as intended?
Here is the complete script for example:
from bge import logic, events
import bge
cont = logic.getCurrentController()
own = cont.owner
keyboard = logic.keyboard.inputs
own.playAction('verme1', 1, 60, play_mode = logic.KX_ACTION_MODE_PLAY)
if keyboard[events.IKEY].values[-1]:
own.playAction('verme1', 1, 60, play_mode = logic.KX_ACTION_MODE_PLAY)
i have recreated this and it work just fine ( tested in UPBGE versions 2.23b2 / 2.24 / 0.3 eevee )
here is the blend used.’ action-inside-if.blend (481.8 KB)