moving an actor forward in intervals

Hello to all.
I’m new in panda3D, I learned python and I was making my first steps in Panda 3D.
The problem is: I was creating a simple game, where there was an actor that moves forward, and I made it using Intervals. The code is like this

walk = panda.posInterval(13,Point3(0,-35,0))

But in this code, my panda, only walks forward to (0, -35, 0), and when it gets to the position, it returns to the initial position. How I can specificate the position relative to the panda and not relative to the general coordinates.

Well, thanks for reading the post, I am only 1 week using panda 3D and I found it very easy (python is very easy too) and the manual in the web helps a lot to learn

PD: sorry for my bad english, I’m spanish and I’m learning

Try specify the node where the position is relative to:

walk = panda.posInterval(13,Point3(0,-35,0),other=panda)

Yeeeeeees :slight_smile: it works now, thanks very much.
another question: the other parameter indicates the node that will be relative to the position right?

The ‘other’ parameter is the NodePath to which the positions are relative. In this case, the panda moves relative to itself (other=panda).

and I can use the same parameter to specify the position of the camera with a task? for example, having the cam allways in front of the panda, or there is another way to do it?
That’s my last question, and thanks for answering me :slight_smile:

If you want your camera to always maintain a fixed position relative to the panda, you can just reparent the camera to the panda and its position will be always relative to the panda.

i have some problem, i want my actor to the task only one time, not looping, and then i want to the actor do an animation

Maybe you could use this?

loop = 1

while loop==1:
        (insert your code)
        loop = 0

To me it sounds more like he wants to use the Interval system. I recommend reading about this in the manual, and also investigating the sample programs.