0

I have a game that does not play sound properly. Lots of other issues there were such as preloading freezed game in android, that are not present in windows but only appears on android. I fixed them taking a long time with alternative approaches but now I can not seem to solve this one. I have a scene autoload that plays sound. On a project I made it play sound without a problem on windows and android and on this project I copied exactly the same thing but it is not working. It plays sound while running on windows. After installing its exports on android it shows following error:

 USER SCRIPT ERROR: Invalid call. Nonexistent function 'playMusic' in base 'Node2D'.
 at: playMusic (res://Scripts/GameManager.gd:113)

How can I refer to that node2d (named as 'MusicPlayer')s attached script instead of in 'Node2D'?

attached script:

extends Node2D

func playMusic():
    $Player.play()

func stopMusic():
    $Player.stop()
    

enter image description here

Rifat
  • 1,700
  • 3
  • 20
  • 51

0 Answers0