Portal 2 objekt carrier

OK, i´ve a problem. I´m looking for a script that´s the same like the portal 2 script, when you can take a cube and throw it around, withe the same collisions, when you throw it. (I´m looking since 2 years) Well, now i ask you, wether you can help me and i hope you know wat i mean. Here is something i´m working on, but the cube collides only IN the cube.


ok.blend (574 KB)


thanks but another question: how it works a little bit faster and go it to a wall and shivers?
Sorry i cant test it know, but im so happy thx!!!

OK, Problem:

I doesnt works! What have I done? It is wrong or is my python to new?

Please help me! grab_init.blend (604 KB)

Fully script for Player.py:

from bge import logic
import fps

class Grabber:

def __init__(self, cont):
    self.cont = cont
    self.camera = self.cont.owner
    self.selector = self.camera.children[0]
    self.coltarget = self.cont.sensors["coltarget"]
    self.lclick = self.cont.sensors["lclick"]
    self.grabbed = None # self.pickup
    self.main = self.pickup

# States  
def pickup(self): 
    if self.coltarget.positive:
        self.selector.applyRotation([0, 0.1, 0], True) 
        if self.lclick.positive:
            self.grabbed = self.coltarget.hitObject
            self.main = self.carry
def carry(self):
    delta = self.selector.worldPosition - self.grabbed.worldPosition
    self.grabbed.applyForce(delta * 100)
    self.grabbed.setLinearVelocity([0, 0, 0])
    if self.lclick.positive:
        self.main = self.pickup

class Player:

def __init__(self, cont, body):
    self.mouse_look = fps.MouseLook(cont, body)
    self.move_wsad = fps.MoveWSAD(cont, body)
def main(self):

player = Player(logic.getCurrentController(),

def main():


please use code tags [noparse]

[/noparse] around your Python snippets. Otherwise it is not readable.

Srry. The script starts after “.py:” and end at the end of my post

Oh, I just bookmarked that tutorial for later. I haven’t done it yet, sorry. :frowning:

Ok, and if somebody can help me:

it shouldn’t shivers and if somebody knows the script of grabbing of portal 2 i hope they can translate it to python(only an idea).

heres an new thing

but its not what i want again. it should be more like poertal. (like the portal grab/ carrying)


dragdrop (1).blend (691 KB)