portal script problem

i followed goran’s tutorial of how to make portals

after done following the tutorial,i press play,then an error message from the console sy this:

Python Script error - object ‘Portal_A’, controller ‘Python’:
Traceback (most recent call last):
File “\Portal.py”, line 58, in main
AttributeError: ‘KX_GameObject’ object has no attribue ‘main’

and i didnt do anything to the code,i wait for a second(because i dont know how to fix that attribute error),then a press play again,and something weird happens, the console didnt say any error,but the portal still doesnt work,why??

here’s the blend file : portaltest.blend (463 KB)

no idea but i know the teleport/portal can be made alot easier. here is my version:
https://blenderartists.org/forum/showthread.php?271816-Basic-Teleport-script-tutorial-2-64

easy to modify and working.

As for youre question, you ask the owner to play main() def.
own.main(), own has no main so u get the error.

@cotax

He wants portals, not simple teleporters.

@muhammad

The script has errors. On line 34, and line 39. It should be:


34.         gobj.setLinearVelocity(mtx_trans * gobj.getLinearVelocity())
39. if delta * self.worldOrientation.col[2] < 0:

@Goran

Thanks Goran :slight_smile: