ShadowApex / godot-go

Go language bindings for the Godot Engine's GDNative API.
MIT License
363 stars 31 forks source link

Problem passing multiple parameters to "RegisterMethod" registered method #48

Open chiguireitor opened 5 years ago

chiguireitor commented 5 years ago

Currently i'm implementing a library in Go which needs to get multiple parameters on a method call:

https://github.com/chiguireitor/godot-gobtcsuite/blob/154bc8fec32c87dc9a8c8f7dba0a67c3850f5605/src/gobtcsuite.go#L280

That call is getting the first parameter right, but the rest of the Variants in the args array come with weird values. For example, calling with 3 ints i do:

fmt.Sprintf("%d %d %d", args[0].GetType(), args[1].GetType(), args[2].GetType()) 

and get

2 81748992 81748992

as result

Edit: It should be noted that the expected result should be 2 2 2 seems like the args array is only getting initialized on the first value, i've been trying to debug this but can't find where's my method getting called to change it on godot's or godot-go's code.

1800alex commented 3 years ago

I'm seeing the same issue here - any update?