BGE occludes an visible object

Hey guys,

I made a little game with a dynamic generated map (like minecraft without blocks) and it worked fine until i noticed a little big bug. The map is made of planes and you are able to move the vertecies up and down:




Now if you jump in the digged hole nothing happens:
But when the “template plane” is out of the view of the camera, the manipulated plane disappears:


(This one has physics visualisation on to show that only the display mesh dissappears)

Heres a link to the .exe (just log in with the given id)(Maybe you can tell me why it looks so bad in the runtime :D):
W,A,S,D,space to move
mouse wheel to edit height
click to make all selected to the height of the centered
if you fall down you will spawn over the map

There are lots of bugs I´m going fix :slight_smile: Espacially the one with the map editing on the edge of planes :slight_smile:

I hope you understand my problem and you know a solution :smiley:

I solved the problem, but with a workaround:) I placed two empty vertecies. One at z=200 and the other at -200, but i had to exclude these from my script, because it placed the vertecies based on their position.

Yea, I’ve run into this problem before. I believe it happens because the BGE doesn’t update the data structure it uses for frustum culling when you move individual vertices around. The solution, as you found out, is to ensure some vertices are in locations that will keep the object within the camera’s frustum prior to moving them.

I believe you may also re-calculate the physics mesh (through Python, or the Edit Object (?) logic brick) to update the object’s bounding box.