If you followed any Python tutorial, you know that in a function (“def”) you need to have everything indented.
On top of that, you are using the Actor class first but then reassigning it to a static model. Wrong. Try this instead:
k, now i get the error message:
C:\Users\Andreas\Desktop\RPGProject>python Script.py
File “Script.py”, line 48
SyntaxError: Non-ASCII character ‘\x91’ in file Script.py on line 48, but no enc
oding declared; see python.org/peps/pep-0263.html for details
seriusly, who understands anything of what they are talking avbout on that page?
ok, but now it says:
attributeError: World instance has no attribute ´LoadCharacter´
sure it has:
def LoadCharacter():
char = Actor("/c/Users/Andreas/Desktop/RPGProjects/models/CharModel.egg")
char.loadAnims({‘Walk’:’/c/Users/Andreas/Desktop/RPGProjects/models/CharWalk.egg’})
char.reparentTo(render)
just because you defined an function !somewhere! doesn’t mean that the world-class has this object. once more. learn python, in this case you might want to look at the object-oriented chapters of some python tutorials.