Search Recursive not working?
Blitz3D Forums/Blitz3D Beginners Area/Search Recursive not working?
| ||
I'm having some trouble here. I have a level mesh with a box called "start1" and i would like to retrieve the coordinates from that box each time i load a new level or area. I have the code and it works fine for other objects im "finding" (such as lights) but it refuses to place the cam & pivot at the box position. Here is the code for the new level loading: And the functions in it: The mesh2 is the collision mesh Thanks for any help! |
| ||
Firstly, do you have collisions set for your pivot and cam? Secondly, have you tried using the global flags? PositionEntity p\piv,EntityX(startpos,true),EntityY(startpos,true)+10,EntityZ(startpos,true),true PositionEntity p\cam,EntityX(startpos,true),EntityY(startpos,true)+10,EntityZ(startpos,true),true Does any of those things work? If not i'll have a closer look at your code :o) |
| ||
Your GetEntFromName function is completely redundant - why not call findchild directly? I think the global flags thing Ross mentions is probably the issue but it seems strange that the light gets positioned ok. Stevie |
| ||
yes, p\piv have collisions Nope, global flags didnt help I've checked my mesh over and over and it seems fine. I feel like im missing something.. |
| ||
Your main problem is what you load. 3DS has NEVER hierarchy so when you load it, you will always get the same result "child wise" as if you used loadmesh. If you want hierarchy you will have to use at least X. But as you use Blitz3D, using B3D would be the best decision. |
| ||
okay, i cant export to .b3d but i can use .x (im using AC3D) ill try it. |
| ||
hmmm... still no worky. What might be wrong? |
| ||
If your pivot has collisions - make sure you 'resetentity' until it is at the desired start position. |
| ||
okay, i feel stupid. The map was loaded before the player was made. But, now that I've switched them around, i get that entity startpos does not exist. Im guessing my mesh is the fault for that. I've had a look at it and dont see any problems, but then I'm not the mesh composition expert. Here it is: http://ncreation.fuller.googlepages.com/cliff.x |