通过示例中看到节点可通过 节点名:pod_anim():start() , 但该方法似乎只能通过scene.节点名:pod_anim():start() 触发动画, 但如果是通过脚本动态创建的动画, 用 node_with_name或get_sub_node_by_name等各种获取方法后则不能触发动画, 代码如下:
scene.bear:pod_anim():start()
这样可以触发动画, 而
get_sub_node_by_name("bear"):pod_anim():start()
或
scene:node_with_name("bear"):pod_anim():start()
则出现错误导致脚本无法继续进行下去, 而由于新尝试 Dumix , 也完全未清楚如何调试和进行下去和出现何种错误.
请求各大神指引.
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
获取节点接口为 bear = scene:get_node_by_name("bear") 你那两个接口使用有误,
同时新旧两套api最好不要混合用(建议使用新版),如果你用了bear = scene:get_node_by_name("bear"),那么播放动画也最好用新的接口:
anim_controller = bear:get_animation_controller()
local config = {}
config["repeat_count"] = 3
local model_anim_session = anim_controller:create_animation_session("model", config)
model_anim_session:play()