Blender中保存并导出后在Unity游戏中模型动画不正常
创始人
2024-12-22 15:30:33
0

可能是由于Blender和Unity的坐标系不同所致,对应的解决方案是要在Blender中将模型的动画应用于整个模型,然后将导出格式设置为FBX并确保选择右向前(right-forward)选择,最后在Unity中使用两个脚本来解决问题。第一个脚本是为了将FBX模型中的动画转换为Unity可以识别的动画格式,第二个脚本用于将FBX模型的动画应用于Unity中的模型:

using UnityEngine;
using System.Collections;

public class AnimationImporter : MonoBehaviour {
    public AnimationClip[] anims;

    void OnValidate() {
        foreach (AnimationClip anim in anims) {
            anim.legacy = true;
        }
    }
}

using UnityEngine;
using System.Collections;

public class AnimationApplier : MonoBehaviour {
    public AnimationClip[] anims;
    public Animator targetAnimator;

    void Start() {
        Animation targetAnimation = targetAnimator.GetComponent();

        foreach (AnimationClip anim in anims) {
            AnimationClip clonedAnim = Object.Instantiate(anim);
            targetAnimation.AddClip(clonedAnim, anim.name);
            targetAnimation[anim.name].legacy = true;
            targetAnimation[anim.name].enabled = true;
            targetAnimation.Play(anim.name);
        }
    }
}

相关内容

热门资讯

盘点一款“蜀渝牌乐汇辅助”hh... 1、盘点一款“蜀渝牌乐汇辅助”hhpoker免费透视脚本(原来有挂)。2、蜀渝牌乐汇辅助透视辅助简单...
黑科技辅助挂!(wePoke)... 黑科技辅助挂!(wePoke)其实真的是有挂,(wepOKE)一贯有挂,黑科技教程(有挂教程);1、...
重大发现“好友赣南脚本插件”w... 重大发现“好友赣南脚本插件”wepoker私人局有透视吗(原生真的有挂)准备好在好友赣南脚本插件 i...
黑科技辅助挂!(aapokeR... 黑科技辅助挂!(aapokeR)本来有挂,(德州aa扑克)一贯真的是有挂,必赢方法(有挂软件);1....
实测揭晓“家家盘锦开挂”hh ... 实测揭晓“家家盘锦开挂”hh poker软件(本来是真的有挂);小薇(透视辅助)致您一封信;亲爱家家...
黑科技辅助挂!(WPK)其实真... 黑科技辅助挂!(WPK)其实真的有挂,(wpK)切实存在有挂,安装教程(有挂透明挂)1、wpK系统规...
玩家必看分享“开心十三水辅助工... 1、玩家必看分享“开心十三水辅助工具”pokerworld破解版下载(切实是真的有挂);详细教程。2...
黑科技辅助挂!WpK透视辅助,... 黑科技辅助挂!WpK透视辅助,Wpk透视ai辅助,2025教程(有挂神器);1、全新机制【WpK软件...
一秒答解“微乐卡五星有挂吗”w... 一秒答解“微乐卡五星有挂吗”wepoker轻量版透视系统(都是真的是有挂)这是由厦门游乐互动科技有限...
黑科技辅助挂!智星德州菠萝辅助... 黑科技辅助挂!智星德州菠萝辅助器工具,智星德州辅助神器,我来教教你(有挂助手)运智星德州菠萝辅助工具...