0 votes

I've been following this tutorial (https://medium.com/kitschdigital/2d-path-finding-with-astar-in-godot-3-0-7810a355905a) But I'm trying to convert the GDScript in the tutorial to a C# equivalent.

In the sections which use a path array variable, it uses a length property / method such as != 0.
But going through the Godot C# docs (http://godotsharp.net/api/3.2.0/Godot.Collections.Array/ ) , and under the array section it does not seem to have an length propetry or method to use.

How would be able to overcome this? Should I use an normal C# array, as I'm storing Vector2 variables in my C# godot collections array of an Vector 2 type.

My declaration of the array is :

private Godot.Collections.Array path;


in Engine by (53 points)
edited by

1 Answer

0 votes
Best answer

According to your linked doc, it has a Count property. I assume that's what you want. Though, it does feel odd for a C#-based array to not have a Length property...

by (10,856 points)
selected by

Thanks jgodfrey. :)

It is strange :) My aim is to see if the array is not empty, would the count property suffice?

I don' t have a Godot-mono instance in front of me ATM but I assume it should work...

Thank you, I Believe it works.

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 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 webmaster@godotengine.org with your username.