base and self

Hi guys,

Is there any diference between self.camera, base.camera and camera ??What should I use?

and the others base.things ?

thx

To access variable/functions of an instance outside of the class, you need to use the dotted syntax:

instancename.variableorfuntions

‘self’ is the same, but inside of the class.
“base” is an instance of the class ‘ShowBase’ and you get it when you import directStart

“self” is no different from any other variable name. It has no special meaning.

“camera” sometimes refers to a global object that is the same as “base.camera”. You should not use it, although there is usually no difference.