Skip to content

Godot4.1.1:关于自定义节点 #1

@LvoryTowerBeta

Description

@LvoryTowerBeta

https://github.com/zfoo-project/godot-start/blob/main/doc/demo01_hello/5.node2d.md 的“自定义节点”的教程,在Godot4.1.1中并不适用。具体表现为:在脚本中编写自定义节点的相关代码时,出现了三处报错。
第一处是class_name MyNode, “res://icon.png”。MyNode后面不能有逗号,以及“res://icon.png”要移到下一行。
第二、三处是在两个export前面,目前export要在前面加@才能用。

2023.9.7 可能这只是个Godot3的教程,打扰了抱歉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions