Interval relative to self oddity.. (Solved, Could Use Info)

I’m trying to animate a swordswing (through intervals). I haven’t finished the animation, but am having trouble with it already. When I play the animation (on left click), the sword teleports to the point directly below me (I am the parent object, so I assume that is 0,0,0 for the sword, as it is parented to me). It continues to animate after that, but I am confused as to why it teleports down there rather than moving in place as I intended… I assume that setPos intervals aren’t relative to self? How do I make it so? I saw no argument for this in the docs…

The panda had been small due to scaling changes during some of the animation tests, and so that’s why I know that the sword was below me (the camera is as though one was riding the panda). However, I now cannot check this, because the panda is big again. I tried hide()ing the panda and show()ing the sword, but this didn’t work.

Any ideas?

Here’s the animation code:

Note that the posInterval was 10,10,5 when the sword showed up below me.

		#Test Animations for Sword


It is played through a simple self.swing.start() command in a task for the left click.

I don’t see anything obviously wrong.

Try printing out the sword’s pos after the interval, to see if it is in fact going where the interval is telling it to go.


I told it to print, then start the animation, then print again. I went in and clicked a few times.

To me it looks as though it inexplicably teleports from

Point3(-60, -200, 900)
(it’s initial position)


Point3(0.0347, 0.0347, 0.01735)

Any idea why?

Ah - the startPos was set to 0,0,0 - and it wasn’t interpreted as relative, so it was teleporting to the origin of the character (below him), which is the sword’s parent, before animating.

I guessed and was right that the startPos/Hpr arg was optional (these things are undocumented damnit!) and set some variables, and this is working. If there is an easier way, let me know though…

Here’s what I’m now using:


whi3/wpi3 aren’t done. I’ll make functions gather the start position of the weapon instead of making them constants like that, but yeah, this has worked for now. It seems there shud be a better way though.

Thanks for prodding me to the right troubleshooting method, mate.

Eh, still have a problem tho - how do I get it to be relative? I don’t want to have to account for previous position every time I move the sword - I can write a function for this, but it seems unintuitive for a panda thing, I’d think there already is one, no?