z3r0_d fps_controls script

hi, i wanted to thank z3r0_d for this great FPS camera script…i managed to invert the mouse and remap the keys, but i encountered some problems :slight_smile:
-when i import an object to put in place of the plane and walk on it, the camera stuck when surface is elevating (not horizontal) and the only thing that i could do then is mouselook and crouch? is it a physic problem, what can i do?
-how to exit when in a runtime, cause the cursor is not here and Esc don’t work

it’s surely basic questions but i can’t figure out how to do…so the better thing is to ask the creator of the script himself :stuck_out_tongue:

I’ll have to look at the problem with slopes

but, for exiting a runtime you can create an keyboard actuator for the escape key, and link it to a quit game actuator

I don’t know if alt+f4 will work [in windows] but it is worth a try as well

ok, i u manage to solve the problem let me know…cause it’s a very useful script. I will try the Esc ket actuator to make the game quit. In my demo, there is a big hole and if the player fall in, it would be great to respawn, is there such an actuator and if yes would it be possible to link it with a sort of sensor that activate when the player is below an z value in world coords?
I realize that i’m in need of tuts on logic blocks and all theses stuff, any link?

the problem is that the tolerance on the ray sensor is too small for going up hills

the Cube.001 object has a ray sensor named “onGround” which it uses to see if it is on the ground. Probably a collision sensor should be used instead [but it needs to be sure it is touching the ground, and not a wall…*]

when this sensor doesn’t pulse, you can’t move. This would happen in the air for example [but, you are probably moving in the air already]

increasing the distance of the ray sensor solves the problem

  • for a collision sensor to be able to tell when colliding with ground, but not walls, you would need to use different materials for both and have the collision sensor only detect one of them. if this didn’t happen you would be able to do weird things like run and jump up walls, which possibly benefical [for example: ladders] is another behavior, and should probably be implemented with seperate logic bricks. To make it easier to debug where the materials are, give them different material colors [which show up in z key solid mode in the 3d view outside of the game engine], but if you wish to have them the same color in a render or something [like a light map] give them textures [such as inverted None textures with a white color] which override the material color.

no, you’ll have to do it [detect that it fell through the hole] in python, or perhaps use a collision sensor on a material you only use inside of there

you’ll probably want to use a scene reset actuator

actually, not really, not that I know of

there are the docs on blender.org, and other things which though slightly different are about as good.

ok i have raised the range of the ray sensor “on ground” it seems to work but do really weird things, like some big speeds boosts/sliding in the air and so :-?

sounds like you’ll want to make it a collision sensor then

yeah i tried that (changed the ray type to collision) but shouldn’t the python script be changed then? and cause i don’t know scripting and have no time to learn it, maybe could i implement the jump feature in the walkthrought_template.blend from blender3d.org since i am using this template right now and it work with hills. i also managed to hide cursor, invert the mouse and put an Esc key to exit like u said…
so could your jump/crouch feature be merged in the template, and how :smiley:

sorry for all theses questons but it’s kinda new for me