+7 votes

Hello, I'm currently looking into making a GDScript version of a project I made in C#. I was wondering, what is the best way to create my own data structs in GDScript?

Let's say, for example, I wanted to create my own Vector3, we can call it MyVector3. How would I best do this? Are classes the best equivalent? Should I use the "class_name" keyword like in this doc page? https://godot.readthedocs.io/en/latest/getting_started/scripting/gdscript/gdscript_basics.html#classes

Is there a way to create default static objects for it, like "Vector3.one"?

in Engine by (111 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.