Hi,
I am fairly new to the BGE and have been following various basic tutorials that have all led me to the same place in which I have a cube with dynamic physics with an always sensor linked to a python controller above a plane, and my script (which I added below).
The issue is:
- That in all the tutorials the cube continuously moves when using the applyMovement method, for mine it simply does one initial movement before the cube begins to fall.
- The cube does not react when I include keyboard interaction, or even print a statement to console when I do keyboard interaction. However, these works when I add a keyboard sensor logic brick.
There are no errors, other than ‘shaders not supported’ in the console. I have tried this on various builds of blender (older versions as for some reason when i hit p in more recent versions blender crashes) and the same results. I have checked my code over numerous times and it is very simple but here it is:
import bge
def main():
cont = bge.logic.getCurrentController()
player = cont.owner
keyboard = bge.logic.keyboard
player.applyMovement([0,0.5,0], True)
if bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.UPARROWKEY]:
print('up key')
main()
Thankyou in advance,
-Goon