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;

Thanks.

asked Apr 4 in Engine by AlMoeSharpton86 (52 points)
edited Apr 4 by AlMoeSharpton86

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...

answered Apr 4 by jgodfrey (5,544 points)
selected Apr 4 by AlMoeSharpton86

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.