![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | bl45kc4t |
I have a function connected with an emit_signal that passes in a Vector2 to use in apply_impulse
func launch(force : Vector2) -> void:
apply_impulse(force)
print(force)
It prints the Vector2 I give it, but does not apply the impulse
However if I pass the Vector2 in by calling launch in func _ready
func _ready() -> void:
launch(Vector2(1000,1000))
func launch(force : Vector2) -> void:
apply_impulse(force)
print(force)
It applies the impulse and prints the Vector2
Why is apply_impulse not taking the connected signal’s Vector2?
Certainly this should be possible. You don’t show the signal wiring or how it’s being emitted, but I suspect the problem is somewhere there. Also, you mention using emit_signal
, but that’s no longer valid in Godot 4 (that’s Godot 3.x).
jgodfrey | 2023-04-13 20:34
I’ve been using Godot 4.0.2 since it’s release and emit_signal does work
Cyber-Kun | 2023-04-14 07:15
Ah, yes, you’re correct. It was (and still is) a method on the Object
class. Sorry for the noise…
jgodfrey | 2023-04-14 13:49