What is the replacement in c# for GD script ":="?

Godot Version

4.2

Question

What is the replacement in c# for GD script for like like this
Which creates Node3D from string path like:

`var Player := “/root/World/NavigationRegion3D/Player”

What is the C# equivalent ? `
Thanks

This does not create a ‘Node3D’.
This creates a string:

	var player := "/root/World/NavigationRegion3D/Player"
	print(player is String)

Outputs ‘true’

I think you must have meant:
var player := $World/NavigationRegion3D/Player

I don’t C# with GODOT but I would be very surprised if there was type inference similar to ‘:=’ since C# is a strictly typed language.

1 Like

problem that player is not scene file , its CharacterBody3D

Ok i found the answer :
Player = GetNode(“/root/World/player”);