![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Zerrtor |
I cannot find how to get the Length of an array for Godot. I’ve tried Length, Count(), and Size() and they all bring different errors.
Length gives
Operator ‘>’ cannot be applied to operands of type ‘method group’ and ‘int’
Size gives
‘Array’ does not contain a definition for ‘Size’ and no accessible extension method ‘Size’ accepting a first argument of type ‘Array’ could be found (are you missing a using directive or an assembly reference?)
Count gives
There is no argument given that corresponds to the required formal parameter ‘what’ of ‘StringExtensions.Count(string, string, bool, int, int)’
Here’s the code.
using Godot;
using System;
public class SoftCollision : Area2D
{
bool IsColliding(){
var areas = GetOverlappingAreas();
return areas.Length > 0;
}
}