0

So I have a 2d Platformer Controller in my game, called Jared. There he is: enter image description here

But I want his face to change when he jumps, I'll design a new picture of Jared when he jumps.

But how can I actually to it? I tried this but It didn't work...,

def input(key):
    if key == 'space':
        player.set_texture(panda3d.core.Texture('new_jared.png'))

I'm kinda new. Thanks for your time.

not_speshal
  • 22,093
  • 2
  • 15
  • 30
makifv
  • 27
  • 1
  • 5

1 Answers1

0

player.texture = 'new_jared'

This is covered in the documentation: https://www.ursinaengine.org/entity_basics.html

pokepetter
  • 1,383
  • 5
  • 8