Meshes attached to bones staying on edge of screen?

Hi! I am using the attachToBone method to equip unit A with armor, and everything works correctly when the camera sees the player and his armor. But I have a strange effect when another player B with armor attached to the bones comes out of the visible area. When I try to follow Player B, halfway through the path, I see his armor flying in the air. It will be there until the camera captures player B’s mesh again. I tried to reproduce in PG, but I couldn’t. Can anyone suggest me something to investigate this issue? It will be very nice to fix it … Anyway, thanks for your attention!

This seems related to the question: ArcRotateCamera's Radius affects the Rotation/Position of attachToBone Meshes - #3 by gbz

@Evgeni_Popov had solved this with skeleton.prepare(). Maybe this could help resolve your issue

@equicolor, could you share which version of BabylonJS you’re using?

I also wonder if this question is related: Skeleton animations stalling / glitching

I’m using Babylon.js 4.2.0. As described in second link

I added myMesh.alwaysSelectAsActiveMesh = true; before cloning the mesh and this seems to have solved the issue.

And it works!

I suspected there was a boolean flag somewhere that will be force render mesh at any time :slight_smile:

I’m not sure the reasons of that behaviors, but it just fixed problem

Thank you so much for such a quick and accurate answer!

1 Like