Making a flexible wire/laser?

Hi everyone!
I’ve been having trouble figuring this out for a while now. :stuck_out_tongue:
I’m making a bendable laser for a physics gun. I already have the gun set up to where it is able to pick up objects, however i want the visible laser (its just there for visualization purposes, it has no other practical application) to lag behind along with the object (the object is picked up in a physically realistic manner). Martins Upitis managed to do this in one of his videos but hasnt made the method publicly available yet ( https://www.youtube.com/watch?v=qwDHFgv58QI ). The only difference in this case is that I only need it to latch onto the center of mass rather than a part of the object’s mesh (i assume that would be easier to achieve).

use a armature,with stretch, manipulate the beginning, a middle point and end

I tried that but it resulted in motion artifacts and some other glitches. (It wouldn’t always disconnect for some reason, sometimes the laser would shake around madly, or the laser would get stuck in mid air.)

also, you can use points in space, and the biezier curve, smoking mirror just posted a example of this

Bgl in bge of something like that, has the Bezier stuff in it,

how do i get the empty to follow the object without parenting though?

While parenting from the blender interface works fine as long as its done before runtime, parenting in the game only grabs the visible object while the physics mesh (or point in this case) [which is required for the bone to follow] is ignored until it is unparented again.

When you select the object, for moving with physics, store it somewhere,

Then in player

If Stored not equal to “empty”------python

Then

 
import bge
cont = bge.logic.getCurrentController()
own =cont.owner
if 'emptyiktarget' not in own:
    own['emptyiktarget']=bge.logic.getCurrentScene().objects['nameOfEmpty']
else:
    if own['Stored']!="empty":
        own['emptyiktarget'].worldPosition=own['Stored'].worldPosition 
    

FIXED!!
Thanks so much for your help man! I really appreciate it. :smiley: