Teleportation task

Can anybody help me with this:

def teleportationTask(self, task):
        ghost = self.GhostNP.node()
        if node in ghost.getOverlappingNodes():
            node.Vec3(setPos(3,3,3))
            print 'teleportation'
        return task.cont

I want to make a teleport but I have an error “libpandabullet.BulletCharacterControllerNode” object no attribute Vec3

I think you meant to do

node.setPos(Vec3(3,3,3))

‘libpandabullet.BulletCharacterControllerNode has no attribute setPos’

You are trying to use a function that exists on the NodePath class, but you are calling it on a BulletCharacterControllerNode, which does not have that function. If you take a look in the API reference you will find what functions exist on each class. I recommend taking a look through the API reference and in the Bullet section of the manual which seems to be well written.
I think the issue you are having is confusion between a “NodePath” (which is used to rotate and move something around), and a “node” (such as the character controller) which is the visual or behavioral part of an object.

node.Vec3(setPos(3,3,3)) 

That should probably be:

NodePath(node).setPos(3,3,3) 

If you want to work directly with the node you could also do this:

node.setTransform(TransformState.makePos(Point3(3,3,3)))

fug yeah :—D.Thanks guys for help, I had some python related errors afterwards but now its working great!

def teleportationTask(self, task):
        ghost = self.GhostNP.node()
        if player.node() in ghost.getOverlappingNodes():
            player.setPos(3,3,3)
            print 'teleportation'
        return task.cont