【发布时间】:2018-03-25 16:00:46
【问题描述】:
我是 Cocos Creator 的新手。
尝试使用操作旋转节点。
openGates(){
const gateLeft = this.node.getChildByName("gateLeft")
const gateRight = this.node.getChildByName("gateLeft")
const rotateLeft = cc.RotateBy.create(2, 40);
const rotateRight = cc.RotateBy.create(2, -40);
gateLeft.runAction(rotateLeft)
gateRight.runAction(rotateRight)
},
我收到了这个错误
Uncaught TypeError: cc.RotateBy.create is not a function
有什么想法吗?
【问题讨论】:
-
cc是在哪里定义的?您可以尝试打印cc并检查可用的功能 -
您也将
gateLeft和gateRight设置为同一个节点,想知道如何处理并发操作(根据Felipe 的评论将引用解析为cc之后)。