so i have a string i want to convert to int but i cant use int() since i use C# so i tried
int.parse in the text editor it gave no errors but when running the game it crashes same with convert.toInt32 `
using Godot;
using System;
public class end : Area2D
{
public static int current_lvl;
private string s;
public override void Ready()
{
s =(GetTree().CurrentScene.Name);
currentlvl=int.Parse(s);}
void onendbodyentered(Node hi)
{
GetTree().ChangeScene("res://scenes/level"+int.Parse(GetTree().CurrentScene.Name)+1+".tscn");
}
}
`note that the scene name is level1,level_2 and so on and i want to extract thatlast number