Another bug ??

Okay before i get angry. I have spent 2 days making a third person ladder climbing using just
logic bricks and animations, i have done it now as you can climb up and down.
Now i come across another problem, they say for every one thing you solve you get 10 more problems.

When climbing the ladder, the animation becomes invisible i think or it stops, but the debug still keeps going
when you get too close to it or view it…it`s confusing, so take a look at this video.

I hope its easy to fix, if not dam blender i cant take it no more :frowning:

Its camera clipping and animation culling

I think there was something about parenting a empty to the armature?

What happens if you turn off the Occlusion Culling under the Worlds Psychics tab? Just as a debug.

From my understanding of the code (KX_Scene::update_anim_thread_func), this might be a “feature” that turns out to be a logical bug.
Because mesh deforms are expensive to calculate (the engine doesn’t seem to use hardware skinning), armature actions are not updated if the deformed objects are not in camera sight.
Which is a problem because the engine allows the progress of an action to be used as a condition for other things to happen.
Probably inspired by quantum mechanics, in BGE some things happens only when you look at them.
It is not a bad decision, it just has an unintended side effect, and it could be transformed into a feature by adding a check box in the ui and a flag to the object: always update this armature.

Would the logic bricks setup fix this? (Sounds too easy):
Always (Pluse True) - AND - Amature “Run amature”

The logic setup is not taken into account in that “culling” routine so it doesn’t matter. The key factor that I think triggers the issue is that the animated object is being culled. If the object passes the cull check then it is also deformed byt a skeletal animation. More or less - I only took a glance at the code.

I turned off culling in physics tab and it works now. The problem is now the mesh disappears on and off, even though
my camera is looking directly at the mesh. Is there any way to fix it or am i doomed lol.
Cheers for the comments :slight_smile:

I can’t really see it in the video, but one thing you need to consider:

The mesh will not be drawn when the original bounding box is outside the camera frustum.

Original means, the bounding box at the start of the scene. Any further deformation will not be considered.

This is a typical problem when the animation makes the mesh move outside of the box.

As said, I can’t tell from the video. It might be that the armature’s origin remains at the bottom of the ladder? I really can’t tell.

(@pgi && Monster: Could you take a look at this: (this makes the animation time computed even if needs_update = false) and tell TristanPorteries what do you think about his patch? And eventually to this too: ? Tristan needs (more experienced than me) reviewers! :slight_smile: )

@ChaosEmergency: As Monster said, the culling issue is produced because the bounding box comes outside camera’s frustum. I took a look to your file last time and see that your hit box was placed around the feet of your character. If you look only at the upper body, the hit box won’t be “seen” by the camera and this will make your character disappear.

There are 2 solutions:

  1. you set your hit box to fit/include “all” your character (and take care to make it larger enough to fit/include your character in all armature poses (max size x, max size y, max size z, min size x…)

  2. You parent a large invisible cube (without physics) to your hit box that will always be in the camera’s frustum.

See the camera is parented to a “Belly box” and that box always follows the armature, as its parented to it. So im confused why its got to do with the player cube. I think its to do with the origin of the armature, as the armature moves the origin obviously stays on the floor.
Then again i`m no expert, i will check that website out youle

Character skin > parented to armature > parented to LARGE hitbox (the one which is around the feet)
or LARGE box (always in frustum… EDIT: not always, but when you look at your character at least :)) > parented to your hitbox (the one which is around the feet)… Not sure… but I think this could work

EDIT: I don’t know, it’s difficult without a .blend file but I think this is the problem

I’m not familiar with the code to review the patch, sorry. Sometimes I just look what exactly it is doing - noting more.