Using some python in the past, I decided to learn some godot and do some basic stuff like creating a main menu of a game. But,
I'm trying to create a main menu in which if the Controller is detected, the bottom two images will show "DPAD to select" and "A to select" whereas there are no controllers, no image will be shown.
I used two TextureRects and this is my code,
extends TextureRect
onready var TextureSprite = $"/root/DPAD"
func _process(delta):
if Input.get_connected_joypads() != []:
print("Joypad Connected")
elif Input.get_connected_joypads() == []:
print("Keyboard Gameplay")
The texturerect's name is DPAD and the scene tree's name is root. The scripts print correctly but I'm unable to change the image. The onready var line of code says that the node was not found although I'm sure it should.