it was about the code i posted in that topic, the tutorial site was free but does not exist anymore.
render.getWindowWidth()
#Gets the width of the window (in pixels)
#Return type: integer
render.getWindowHeight()
#Gets the height of the window (in pixels)
#Return type: integer
for visibility:
check if you have the engine running on glsl
set the render option on bottom from material to texture
check if the face direction is correct (flip normals if needed (or rotate the plane 180 degree and see if it then stays visible))
it can be anything and we can’t see that with a screenshot
def get_scene(scene_name):
scenes = logic.getSceneList()
scene = None
for sce in scenes:
if sce.name == scene_name:
scene = sce
return scene
to use this just write a line like:
scene = get_scene('scene_name')
object = scene.objects['object_name']
or use:
def get_scene(scene_name):
scenes = logic.getSceneList()
scene = None
for sce in scenes:
if sce.name == scene_name:
scene = sce
return scene
def get_object(scene_name, object_name):
scene = get_scene(scene_name)
object = scene.objects[object_name]
return object
def detection(cont):
own = cont.owner
collision = cont.sensors['Collision']
if collision.positive:
hit_obj = collision.hitObject
if 'some_property' in hit_obj:
#do something
elif 'some other property' in hit_obj:
#do something else
#repeat as many times you want
I already have this in my code except the line “if ‘some_property’ in hit_obj” , which can be useful to add. But I found this that it missing in my code:
(if it can help)
The for loop runs trough all things hit/touched by the collision sensor.
if you are sure to have multiple collisions at the same time then use the for loop else use mine.
In standard BGE, you’ll have to replace the mesh itself; own.replaceMesh(meshName) – this means you need to have an alternate version of the mesh using a separate material ready in your scene somewhere.
In UPBGE, you can copy the mesh at runtime, replace it, then replace the material on that copied mesh.
With this method, i tried to reduce the hitbox in order to create a ‘sneak movement’ and to pass through narrow passages like Under these yellow-orange blocks.
back in the day that only would work with triangle bounds. but this in time will have issues itself, so you need to see if you have some issues with it.
so object and the new mesh needs to be set as triangle collision
well you need to APPLY the textures in the game engine, not in render or cycles.
why the faces disappear is not clear but you can simply select the cube got into edit mode and recalculate the normals.
in edit mode, hit T to open side menu hit the shading/uv tab, under normals you can then hit recalculate or flip direction.
So what your Issue is is not that textures are missing but that your material has backface culling enabled. You can disable it in the materials tab and it should work fine.