collisions within a type?
Blitz3D Forums/Blitz3D Programming/collisions within a type?
| ||
Is it possible to have an entity located within a type ( such as the main environment?) What is boggling me is that the code using types doesnt allow my player to move yet the non-type world environment works fine. Player movement is ok with this code: ;world world = LoadMesh ("level1\world_stonehenge.b3d") If world <> 0 ScaleEntity world,1,1,1 PositionEntity world,0,0,0 RotateEntity world,0,0,0 EntityType world ,TYPE_WORLD Else RuntimeError "Could not load world!" End If And this code DOES NOT work... What is happening is the player is getting stuck in the center of the world. My movement controls will not work when I change the variable world to a type. ;world world.world = New world world\ent = LoadMesh ("level1\world_stonehenge.b3d") If world\ent<> 0 ScaleEntity world\ent,1,1,1 PositionEntity world\ent,0,0,0 RotateEntity world\ent,0,0,0 EntityType world\ent, TYPE_WORLD Else RuntimeError "Could not load world!" End If |
| ||
The type code looks fine, the error must be somewhere else. |
| ||
Thanks Tom, I will try to dissect the rest of the code then. The world type must be causing some conflicts elsewhere. Thanks -c |
| ||
Well heres my thoughts: (p.s.-80% sure its the scaleentity, i have big problems with scale entity and fitmesh, its either that or updatenormals) 1. ScaleEntity has bugs, its most likely changing your collisions. Try starting out your char y# higher and then gradually move him down and see where he stops. 2. Try updatenormals world/ent, probably won't make a diff. 3. You are not setting entityradius or box for world. Which i may be wrong but i don't recommend polygon to polygon for world. 4. I would consider loadmesh world1,scale it, and then use world\ent=CopyEntity(world1), don't forget to hide world1. (you will have to manually add the textures to the world though) 5. Remove RotateEntity 0,0,0....no point in doing so. 6. If you aren't setting type_world as a constant you should. 7. Try text type_world, and possibly other variables at diff parts of the program, and then flip/delay, see if it changes. I had a problem with some old code that some globals at least would get lost after getting function calls. Try not to next several functions to another, stay as close to the main program as you can. |