What is the name of this menu, and how can I add new types to it? #Resource #Property

Godot Version

4.2.1

Question

Hi guys!
I have written a Gdscript named “Attack Skill” and I want this Object Type List Selector(?) to expose my script and I want to expose the properties like in the picture attached at the end so that I can put values into it. Is there any way to do this?
image

Thx!!

1 Like

Check out the documentation on GDScript exported properties.

@export var x: int = 20
@export var y: int = 20

You can even export arrays.

3 Likes

Thanks for the answer :slight_smile:

I think there was a misunderstanding because I only attached one picture.

My exact query is as follows

  1. when I set the Type to Object in the meta data menu, Array, etc, I meant the exposed properties, like the photo.

I’m used to using @export in inspect to raise variables, but I’m not sure how to do it in the object detail(?) viewer.

You probably want to work with Resources.

Make your Effect class extend from Resource

extends Resource

class_name Effect

@export var damage:float

Then on your player or the node you want to use you export a variable of that type

extends CharacterBody3D

@export var skill_effect : Effect

And now you can just plug your effect.
You can create then inside the inspector just like you do with collision shapes.
image
image

Or you can right-click on the file-system window and CreateNew->Resource of type Effect and then just drag the created Resource.
image

2 Likes

Oh, thank you so much.

That viewer was the Resource Editor!
That got me where I wanted to go.

Have a great day, both of you!
@Gustjc @GBWD

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.