Deparenting

  • Thread starter Thread starter Mad Monk
  • Start date Start date
M

Mad Monk

Guest
Hello,

I’m working on a little project where lights are powered by a generator. The way the lights are powered is that they are connected to a plug. You can then pick up the plug and insert it into the generator, which will power the lights. The generator is a prop_physics_overide so you can move it around all you want. I’m almost done but I keep on running into a snag. In order to attach the plug to the generator I’m using the setparent command… but the problem arises when I try and remove the plug.

Instead of the plug just falling to the ground next to wherever the generator is... it returns to the location where it is parented to the generator. In my unplug logic I have the plug disconnecting from the generator it is parented to by enabling it's motion and then the command clearparent. This action of setting it to void sends it back to the location that it was connected to the generator at... so for instance if I plug into the generator and then carry the generator across the room when the plug ejects it pops out in the original location where I plugged it in... not to where I moved the generator. Is there another command that will fix this? If I didn’t explain myself properly let me know.
 
Back
Top