godotengine / godotengine/godot-docs
Explain how to use @export with custom resources
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
### Your Godot version:
v4.0.3.stable.official [5222a99f5]
### Issue description:
The [page regarding exports](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_exports.html) is awesome but it doesn't mention whether or how it's possible to use **custom classes or resources** with `@export` (If I understand correctly only custom resources is possible).
A simple example regarding custom resources would help a lot, e.g.:
`potion.gd`:
```
extends Resource
class_name Potion
@export var name:String
@export var effect:String
```
`example.gd` used by `example.tscn`:
```
extends Node2D
const Potion = preload("res://potion.gd")
@export var equipped:Potion
@export var pouch:Array[Potion] = []
```

### URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_exports.html
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.