i have a problem with light

i been reading your manual and playing around now for about 3 weeks and i’m have a problem understanding your manual under lighting i can’t get it to work i think its sometihng dumb and small i over looked and i’m sorry to take up your time for something soo dumb :frowning: heres my code

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

ship = loader.loadModel("models/data/ship")
dlight = DirectionalLight('my dlight')
dlnp = render.attachNewNode(dlight)


heres the output of the program

Traceback (most recent call last):
  File "c:\game\game2.py", line 11, in <module>
    dlight = DirectionalLight('my dlight')
NameError: name 'DirectionalLight' is not defined

You need to import it first:

from pandac.PandaModules import DirectionalLight

thanks alot mate :slight_smile: sorry for being soo dumb