Modify Object at Runtime

I have a long triangle shaped plane. I need to place the single vertex point of the triangle at a given position during runtime, while keeping the other two points in their starting location. (It’s a lightning bolt that always originates from the same place, but strikes different locations.) What would be the best way to achieve this?

I have tried moving the vertex and while Python tells me that the vertex has moved, I don’t see it move in the game. Anyone know if there is something simple I am missing to move a vertex?

    
    own = cont.owner    
    mesh = own.meshes[0]
    
    vert = mesh.getVertex(0,1)
    vert.setXYZ([-50, -50, 0])

The -50 is arbitrary. It doesn’t matter what I put in there, the vertex NEVER moves.

I have also set up an armature. When I enter pose mode and move the bone, it moves EXACTLY how I want it to. Is there any way to move the bone to a worldPosition at runtime?

    
    own = cont.owner    
    mesh = own.meshes[0]
    
    vert = mesh.getVertex(0,1)
    vert.setXYZ([-50, -50, 0])




to me this code work, tried on a plane (without armature)

i not understand if you wnat move vertex or bone.

move bone in wp with python is possible but not simple
there constraint that can do it , as “copy transorm” or copy location(world->world)

Well I solved the problem but it was the strangest thing I’ve seen in Blender. No objects that I add to my current blend can have their vertexes moved, but if I create the object in a new blend and then append it, it works fine…very strange.

Anyone know of any reason that the new objects I add can’t have their verts moved at runtime?

Post a .blend.