I am making a minecraft game in Ursina Engine
in that I added a function that checks for a key to be pressed and give me the specific block. but my code doesn't seen to work for some reason. I don't know the reason. And I have used the keyboard module for key detection. Here is the code----
def Update():
global current_texture
if keyboard.is_pressed('1'):
current_texture = grass_texture
if keyboard.is_pressed('2'):
current_texture = dirt_texture
if keyboard.is_pressed('3'):
current_texture = stone_texture
if keyboard.is_pressed('4'):
current_texture = wood_plank_texture