0 votes

Hola es posible que un emisor envie una señal a un hermano?
Como hago referencia a un nodo hermano ya instanciado para indicarle que ejecute su metodo mediante connect?

var pelota=load("res://pelota-Football/pelota.tscn")

Me da el siguiente error:
E 0:00:12.341 emitsignal: Error calling method from signal 'patear': 'PackedScene::aumentarvelocidad': Method not found..
core/object.cpp:1257 @ emit_signal()
jugador.gd:25 @ _input()

¿porque busca el metodo en PackedScene?


in Engine by (20 points)

1 Answer

+1 vote
Best answer

I think what you need is:

pelota.connect ("patear", self, "aumentar_velocidad")

because the signal is emmited from pelota. And you need a function in your current script

func aumentar_velocidad():
by (805 points)
selected by

The signal is emmited from jugador :


jugador is nodo brother

Where is func aumentar_velocidad

The function aumentar_velocidad is on the pelota.
I solved it by creating a main node, pelota parent and jugador and connecting them as follows in main.gd:

func ready():
#conecto señales entre nodos
$"RigidBody mundo/jugador".connect("patear",$"RigidBody mundo/pelota","aumentar

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.