Music timing

Hello everyone again

I try to schedule the sound (a car) by command
When I multiply it with the variable “Y”

But I can not get to catch up with the real Y position of my car
It always takes the
getY initial

How can I make it run right?

this is my code:

class MyApp(ShowBase):
    def __init__(self):
        self.front = Actor("car")
        self.front.setScale(7, 7, 7)
        self.front.setColor(0.6, 0.6, 1.0, 1.0)
        self.front.setPos(-70, 2300,25)
        mySound = base.loader.loadSfx("test.ogg")
        def Ps(self):
        imageObject = OnscreenImage(image = 'try.png', pos = (-0.5,0,0.02),parent=render2d)
        pandaPosInterval1 = self.front.posInterval(13,
        Point3(0, -10, 0),startPos=Point3(-70, 2300,25))
        pandaHprInterval1 = self.front.hprInterval(3,
        Point3(180, 0, 0),
        startHpr=Point3(0, 0, 0))
        self.pandaPace = Sequence(pandaPosInterval1,name="pandaPace")

app = MyApp()

like you can see i need to make
Def Ps

You want to make Ps into a task. Try taking a look at the Task section in the manual. Also look at the sample programs, some of them demonstrate the use of tasks. There are also plenty of examples of tasks in the forums.


you help me it’s working