Play sample sound on_hover?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rylok
:warning: Old Version Published before Godot 3 was released.

I’m trying to play a ‘hover’ sound when the mouse goes over a TextureButton, but whenever I try, and I load the game, there’s no sound, and the game is unresponsive. Here’s what I’ve got:

extends TextureButton

func _ready():
	set_process_input(true)
	
func _input(event):
	if self.is_hovered():
		get_node("Samples").play("hover")

I’ve tried putting the conditions in through the SamplePlayer, but still nothing. I’ve also tried with a fixed process.

:bust_in_silhouette: Reply From: Zylann

Try with the mouse_enter signal:

extends TextureButton

func _ready():
	connect("mouse_enter", self, "_mouse_enter")

func _mouse_enter():
	get_node("Samples").play("hover")

Still having the same issue with the game not responding, and no sound plays. Thanks for answering, though! Hopefully this can be figured out. :slight_smile:

Rylok | 2017-04-01 21:28