hi,
I’ve currently started a new project about portals, so I asked Mr. Goran on his website and luckily I got the highest votes so he answered me (yes, I am EMC), so I used the portal script with his ray sensor tutorial to make the portal gun, but now I’m having a few problems; when the player gets in one of the portals while it is oriented in a weird way (for example on the graound), the player gets out of the other portal upside down so my question is : is there a way to make the player always fall on it’s “feet”?
and another problem that I had was that when I add a portal near the edge of a wall it generates most of the portal outside the wall (http://dl.dropbox.com/u/32414374/portal%20problem.PNG) (there is a ground where that wall ends, it’s just that I took a snapshot while I was falling :P) and that is a problem because when I enter the other portal (the orange one in this case) I come out falling because that part of the portal is outside, so is there a way to fix it?
Oh! and the portals have to be a specific distance from the wall for them to work, it’s not really a big problem but if there is a fix for it then that would be appreciated too
I will add the name of the person who answers any of these questions in the credits so I think it would be cool, don’t u ;D
ok, so I found a way to make the portals teleport almost like the actual game but it will take some time to make the actual level since I’m going to be making it out of non-scaled planes (2 layers), because I don’ know how to use python obviously XD, so it will require a fairly good computer to run the game, but I still have the player problem, which is to point it’s “feet” always to the bottom (-Z Axis)
so can any1 help me with that?
you may be able to solve this by using a constraint actuator. select “orientation constraint”, set “direction” to be “z-axis”, and for “Reference” set the zaxis to the maximum number, and this should work.
Easy enough would be this, add it after the movement part of the teleport script.
remember to import mathutils
# Assuming the player object is set
world_z = mathutils.Vector((0, 0, 1))
empty_vector = mathutils.Vector.Fill(3)
player.localAngularVelocity = empty_vector
player.alignAxisToVect(world_z, 2)
thanks guys! that really was kind of you :D, unfortunately I tried agoose77’s technique but I couldn’t get it to work, probably because I suck at python XD (I’m very new to python, in fact it is the first programming language that I’m learning) so I tried kendrick1397’s technique and it worked but I couldn’t move the player on the z-axis (for the mouselook script that I got from www.tutorialsforblender3d.com) so I tried to set a maximum point and it worked with 0.100. so now that this problem is over there is still the other one, which is the second one where the portal generates a little bit off the wall, so can any1 help me with that?
I did import mathutils and I knew that the problem is from the player object (thank god for the console :P) but I didn’t know how to fix it, do you want to see the scrip?