Help?

Ok im totally new to Panda3d and im trying to get through the first tutorial but knowing my bad luck I always run into problems lol >.<

So im going along the panda hello world tutorial all the way up to the Controlling the Camera

http://www.panda3d.org/manual/index.php/Controlling_the_Camera

Everything seemed to be working just fine before this in the Command Prompt and I dont think im doing anything wrong, the code is the same exsact code off of the page up there.

heres the code they give you.

import direct.directbase.DirectStart 
from direct.task import Task 
from direct.actor import Actor 
import math 

#Load the first environment model 
environ = loader.loadModel("models/environment") 
environ.reparentTo(render) 
environ.setScale(0.25,0.25,0.25) 
environ.setPos(-8,42,0) 

#Task to move the camera 
def SpinCameraTask(task): 
  angledegrees = task.time * 6.0 
  angleradians = angledegrees * (math.pi / 180.0) 
  base.camera.setPos(20*math.sin(angleradians),-20.0*math.cos(angleradians),3) 
  base.camera.setHpr(angledegrees, 0, 0) 
  return Task.cont 

taskMgr.add(SpinCameraTask, "SpinCameraTask") 

run() 

Heres the same code I wrote from the code above in PyPE

import direct.directbase.DirectStart
from direct.task import Task
from direct.actor import Actor
import math

#Load first environment
environ = loader.loadModel("models/environment")
environ.reparentTo(render)
environ.setScale(0.25,0.25,0.25)
environ.setPos(-8,42,0)

#Task to move the camara
def SpinCameraTask(task):
    angledegrees = task.time * 6.0
    angleradians = angledegrees * (math.pi / 180.0)
    base.camara.setPos(20*math.sin(angleradians),-20.0*math.cos(angleradians),3)
    base.camera.setHpr(angledegrees, 0, 0)
    return Task.cont

taskMgr.add(SpinCameraTask, "SpinCameraTask")

run()

I dont know what im doing wrong but its simple as I hear you guys have a good community and I just want to learn panda3d real bad >.<

So outta my command prompt comes this after i go and type in what i wanna run

C:\Panda3D-1.3.2\mystuff>ppython hellopanda2.py

And then heres what happens

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  wglGraphicsPipe
(3 aux display modules not yet loaded.)
:util(warning): Adjusting global clock's real time by 1.98394 seconds.
:util(warning): Adjusting global clock's real time by -1.55903 seconds.
Traceback (most recent call last):
  File "hellopanda2.py", line 22, in ?
    run()
  File "C:\Panda3D-1.3.2\direct\src\showbase\ShowBase.py", line 2028, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.3.2\direct\src\task\Task.py", line 839, in run
    self.step()
  File "C:\Panda3D-1.3.2\direct\src\task\Task.py", line 787, in step
    self.__stepThroughList(taskPriList)
  File "C:\Panda3D-1.3.2\direct\src\task\Task.py", line 721, in __stepThroughLis
t
    ret = self.__executeTask(task)
  File "C:\Panda3D-1.3.2\direct\src\task\Task.py", line 644, in __executeTask
    ret = task(task)
  File "hellopanda2.py", line 16, in SpinCameraTask
    base.camara.setPos(20*math.sin(angleradians),-20.0*math.cos(angleradians),3)

AttributeError: ShowBase instance has no attribute 'camara'

Maybe im a total idiot or maybe not but either way i want to get past this little stump ive come to, help would be great thanks :smiley:

Try replacing “camara” with “camera”. It will work then.
enn0x

Thanks alot man, really thank you alot lol i feel so stupid now that it was just that lol…