Help whit the buttons.

How to fix the button:

import direct.directbase.DirectStart
from direct.task import Task 
from direct.actor.Actor import Actor
from pandac.PandaModules import * 
import sys
from direct.interval.IntervalGlobal import *
from direct.interval.FunctionInterval import Func,Wait
import direct.directbase.DirectStart
from pandac.PandaModules import AmbientLight,DirectionalLight
from pandac.PandaModules import LightAttrib
from pandac.PandaModules import TextNode
from pandac.PandaModules import Vec3,Vec4
from direct.showbase.DirectObject import DirectObject
from direct.gui.OnscreenText import OnscreenText
from direct.interval.MetaInterval import Sequence
from direct.interval.FunctionInterval import Func,Wait
from direct.actor import Actor
from random import random
import sys
import direct.directbase.DirectStart 
from direct.showbase.DirectObject import DirectObject 



#Load the first environment mode
enviroon = loader.loadModel("models/ssw1.egg")
enviroon.reparentTo(render)
enviroon.setScale(0.25,0.25,0.25)
enviroon.setPos(0,0,0)

#Load the first environment mode
environ = loader.loadModel("models/ss1.egg")
environ.reparentTo(render)
environ.setScale(0.25,0.25,0.25)
environ.setPos(0,0,0)

#nviron = loader.loadModel("models/blackground.egg")
#nviron.reparentTo(render)
#nviron.setScale(0.25,0.25,0.25)
#nviron.setPos(0,0,0)


#base.disableMouse()


ssw1 = loader.loadModel("models/ssw1.egg")

player = ssw1 

dummy=render.attachNewNode("models/ssw1.egg") 
base.camera.reparentTo(dummy) 
dummy.setPos(10,100,10) # 10 = distance between cam and point 
dummy.setH(0) #this will rotate it 60 degrees around the point

base.cam.lookAt(ssw1)


plight = PointLight('plight')
plight.setColor(VBase4(4, 0.2, 0.2, 100))
plnp = render.attachNewNode(plight) 
plnp.setPos(0, 10, 0)
render.setLight(plnp)

 #Create the four lerp intervals needed to walk back and forthpanda
s=plnp.posInterval(0.5,Point3(10,20,10))
f=plnp.posInterval(0.5,Point3(40,40,-10))
g=plnp.posInterval(0.5,Point3(0,10,0))


#mySequence=Sequence(s,f,g)

#mySequence.start()

#mySequence.loop()

  
h=environ.posInterval(0.5,Point3(10,10,10))
j=environ.posInterval(0.5,Point3(40,30,-10))
l=environ.posInterval(0.5,Point3(0,0,0))


sySequence=Sequence(h,j,l)

ss = Func(l)


#z=dummy.posInterval(0.5,Point3(20,20,20))
#x=dummy.posInterval(0.5,Point3(50,40,0))
#c=dummy.posInterval(0.5,Point3(10,10,10))

#mySequen=Sequence(z,x,c)

#mySequen.start()

#mySequen.loop()

def __init__(self):
    

 self.acceptOnce( "a" , l )
 
run() 
 
 
 
 

I really recommend following a Python tutorial before you attempt something like Panda3D.

that is correct, let say you must to begin understanding about object oriented programing, the init you wrote at the finish, is the first method you must to call and put all others things inside it…

from direct.task import Task 
from pandac.PandaModules import * 
from direct.interval.IntervalGlobal import * 
from direct.gui.OnscreenText import OnscreenText 
from direct.actor import Actor 
import direct.directbase.DirectStart 
import random
import sys

class Main(DirectObject):
     def __init__(self):
            self.acceptOnce("a", self.number1)

     def number1(self):
            "the thing you want to do by pressing "a" "
             ...
             ...

Excuse me, is weird, you have 21 messages so are not so novice in panda forum… anyway, here let you a good and fast to learn tutorial for python :

http://www.voidspace.org.uk/python/articles/OOP.shtml

Good luck.

i recommend panda in combination with python to learn python and panda. :smiley: (dont get angry pro-rsoft, its only my impression) thats the way i use to, and i had a pretty fast grown learn curve. but maybe it only works if you are into cg, that would brings you the right motivation. if you are not into cg, better dont burn your fingers by cg, could hurt a lot. you know there more pixels around than doctors :wink: and not every doctor is a rat. and in overall its only about the philosophy of pixel, mirrors and doors. your imaginationskills is displayed by coding. it could makes you nacked on the southpol. there is nothing more creative like programming!

but, pro-rsoft have right too.

greetz
a nice guy :slight_smile: