My player is FALLING!!!!!!!!!!!!
Blitz3D Forums/Blitz3D Beginners Area/My player is FALLING!!!!!!!!!!!!
| ||
My player has a huge problem with falling through the ground. Is there something wrong in this function that could be causing the error? Player = p1_coll Terrain = fl1_coll My game could never be played with the player falling through the floor! What have I or havent I done!!? Last edited 2011 Last edited 2011 |
| ||
I do not know what I could have done wrong on this! Help please! :) |
| ||
You've mentioned: Player = p1_coll Terrain = fl1_coll ... and your code contains Collisions fl1_coll,p1_coll,0,0 ;Gravity set Collisions p1_coll,fl1_coll,0,0Which certainly looks wrong. |
| ||
You've set some collision responses to 0, which I believe will disable collisions for that type. Since you've set all of your entity types to 1, I'm not even sure if it will work to begin with. Rather than this:Const p1_coll=1 Const op1_coll=1 Const WW1_coll=1 Const fl1_coll=1 Const off=0 Try this. It might help: Const p1_coll=1 Const op1_coll=2 Const WW1_coll=3 Const fl1_coll=4 Const off=0 ;Don't know what this is used for. If you want your player to collide with the level, then it's important that your character has EntityRadius applied and that your character is checking its radius again the polygons, not the radius, of the level. Otherwise, your character might fall through the level when it reaches the end of the imaginary bubble. So, collisions should look more like this example: Const type_hero = 1 Const type_level = 2 Global hero = CreateSphere() EntityRadius hero,10 EntityType hero,type_hero Global level = LoadMesh("Some Mesh Here.b3d") EntityType level,type_level Collisions type_hero,type_level,2,3 This piece of code will check the type_hero (1) to see if it collides with type_level (2). It will do so using method 2 (the entity radius against the polygons), and with response 3 (do not slide down a slope). In other words, this will use the hero's radius of 10 units to check if that "bubble" is touching any of the triangles of the level. This is the most accurate while at the same time being the most efficient method to check for collisions on a level. Plus, like Floyd says, it doesn't even look like you're checking your character against the level at all yet. |