Collisions on map made of cubes with fps controls
Blitz3D Forums/Blitz3D Programming/Collisions on map made of cubes with fps controls
| ||
I got my map generator working with Fps controls but it seems the collision does not want to cooperate. I have floor and ceiling cubes and wall cubes. There should be enough space in the middle but the collision seems to move the camera outside of the map. This is the line I use to active the collision. ;Collisions type_camera,type_scenery,2,3 I create the cubes as type_scenery. Might be a bit long : edit : maybe this belongs in beginners area. :) edit : http://cromdesi.home.xs4all.nl/games/fpsrandommap/fpsrandommap.7z (textured exe) |
| ||
pretty weird colors---- maybe you should create a "Plane" to select as the type_scenary........ then you would have a universal floor- as you move your player/camera entity then you could add a tiny amount of down gravity (say -0.1) to keep the player planted. As for the cubes and "doorways" themselves- you would create them at entx,entz, and enty(up and down) would stay at 0 (zero). also the crazy left and right yawing and pitch is hard to control when tying it to the mouse movement. |
| ||
I am still trying to fix it. Sometimes the player is inside the map and sometimes he spawns outside of the map. ('1' to make new random level) When he is inside the map then everything works as it should. The collision then works. The placeplayer function I am working with trying to get every spawn working. When the collision is disabled then he spawns more frequently inside the map. I have spend quite some time on it already but can not seem to find what is wrong. |
| ||
I updated the code in the first post. It runs faster now. I had the framerate timer set at 10. Everything works as I want it when the player is inside the level. I have not found yet what causes him to be spawned (1) outside. |
| ||
Do a ResetEntity( your_entity ) after you 'teleport' a collision enabled entity. Otherwise it will be stopped by the first collision enabled object it intersects. http://www.blitzbasic.com/b3ddocs/command.php?name=ResetEntity&ref=3d_cat |
| ||
Yeah, that worked :) Thanks. Here the working version with some textures added : http://www.blitzbasic.com/codearcs/codearcs.php?code=3277 |