随笔分类 -  cocos creator 3.8

摘要:1、在物体的固定方向和距离放一个node1 2、 node.setPosition(this.node1.getWorldPosition()); node.setRotation(this.node1.getWorldRotation()); node.setScale(this.node1.ge 阅读全文
posted @ 2024-09-26 11:26 流星曳尾 阅读(20) 评论(0) 推荐(0)
摘要:let v = 100; let v3 = new Vec3(this.cylinder.forward.x * v, this.cylinder.forward.y * v, this.cylinder.forward.z * v); this.cylinder.getComponent(Rigi 阅读全文
posted @ 2024-09-19 14:29 流星曳尾 阅读(27) 评论(0) 推荐(0)
摘要:放到BoxCollider里了。setPosition到外面就好了 阅读全文
posted @ 2024-09-11 17:51 流星曳尾 阅读(8) 评论(0) 推荐(0)
摘要:start() { input.on(Input.EventType.MOUSE_DOWN, this.onMouseDown, this); } onMouseDown(event: EventMouse) { switch (event.getButton()) { case EventMous 阅读全文
posted @ 2024-09-11 14:34 流星曳尾 阅读(43) 评论(0) 推荐(0)
摘要:物体加刚体和碰撞组件 地面加静态刚体和碰撞组件(不静态就会被砸着往下走) 不加碰撞组件就会穿过去 阅读全文
posted @ 2024-09-10 19:25 流星曳尾 阅读(44) 评论(0) 推荐(0)
摘要:放进去的图类型是Texture。要改成sprite-frame才能作为sprite的Sprite Frame 阅读全文
posted @ 2024-08-26 17:35 流星曳尾 阅读(25) 评论(0) 推荐(0)
摘要:Camera 设置为 Player 的子节点。 这样 Camera 就会跟随 Player 的移动而移动了。 阅读全文
posted @ 2024-08-22 11:29 流星曳尾 阅读(88) 评论(0) 推荐(0)