ECG_Kinsey 我们有这样一个需求,需要在运行时将某个插槽的附件置为空,如将角色手持的武器设置为空,并且获取该角色不手持武器时候的网格,我尝试通过Slot.Attachment = null的代码来清空附件,但是似乎在Update中该插槽的附件又会因为应用时间轴上的插槽附件而被再次覆盖,从而再次显示出来。 请问我需要怎么做才能实现我这个需求,谢谢
Harald @ECG_Kinsey This sounds as if your animations key attachments which they should not. Either: A) Modify your animations so that they don't key the attachment. If the attachment was not intended to be keyed by your animations, perhaps your animations have keyed everything in the first frame? B) Call Slot.Attachment = null; at the proper time, every time after animations are applied but before your mesh is generated via registering to the SkeletonAnimation.UpdateLocal callback. Check out the documentation here, subsection SkeletonAnimation Update Callbacks.
ECG_Kinsey Harald 首先,谢谢您及时的帮助 我们的特效需要根据角色身体的网格范围来生成,但是需要排除武器网格的影响,所以需要在运行时隐藏武器插槽的附件。 我们检查了我们动画的关键帧,动画A种不存在角色左手武器附件的关键帧,动画B的具有角色左手武器附件的关键帧,当从动画B切换到动画A的时候,会因为融合的原因覆盖Slot.Attachment = null所产生的将附件置空的效果 我们会继续尝试,通过您上述的B方法,也许能解决我们的问题
Harald @ECG_Kinsey Glad to hear it helped. I also assumed that A is not an option, I mainly mentioned it for sake of completeness and as a potential easy fix.