Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Syl |
Greets!
Here’s the trouble: I’m tryin to change scene after a click on a polygon2D and an animation, but it won’t be loaded, as I get that error message:
'0:00:14:0229 - Error calling method from signal 'input_event': 'CollisionPolygon2D(Soulpoly.gd)::_on_Area2D3_input_event': Method not found.
----------
Type:Error
Description:
Time: 0:00:14:0229
C Error: Error calling method from signal 'input_event': 'CollisionPolygon2D(Soulpoly.gd)::_on_Area2D3_input_event': Method not found.
C Source: core\object.cpp:1202
C Function: Object::emit_signal
The weird is that I got two others collisionpolygon2D with same scripts, signals and animations workin perfectly well. Here’s the screenshot:
Imgur: The magic of the Internet With soulpoly bein my unefective collisionpolygon2D.
Renamed, formatted and tagged post
Zylann | 2018-03-09 13:49
Do you have a function called _on_Area2D3_input_event
on Soulpoly.gd
? (which is basically what the error is about, can’t guess more even with the screenshot)
Zylann | 2018-03-09 13:51
Yes, here’s the full script:
extends CollisionPolygon2D
func _on_Area2D_input_event( viewport, event, shape_idx ):
if event is InputEventMouseButton:
if event.get_button_index() == BUTTON_LEFT and event.is_pressed():
get_node("AnimationPlayer").play("change")
func _on_AnimationPlayer_animation_finished( change ):
get_tree().change_scene("res://Scenes/Name.tscn")
But I got exactly the same with mindpoly and bodypoly, and that works perfectly…
Syl | 2018-03-09 13:56