-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Probelm with AnimationPlayer (suspecting gd.Real does not translate well) #47
Comments
I discovered that if you use the generic // len := anim.GetCurrentAnimationLength()
len := anim.Get("current_animation_length") @ShadowApex can you maybe make sense of this? |
i ran into the same issue. i'm going to see if i can get to the bottom of this. looks like it might be a mangling of arguments |
just an update. the fix is to cast float arguments into you can see an example of the use of the function here: https://github.com/godot-go/godot-go/blob/master/test/pkg/gdnativetest/object_player_character.go#L161 you can look at the code generation here: https://github.com/godot-go/godot-go/blob/master/pkg/gdnative/classes.gen.go. You'll have to search for |
@pcting Nice Job! |
my best reference was looking at the godot-cpp project. it also helped asking questions in the gdnative-dev room on the discord servers. i originally decided to create my own godot-go library to better understand cgo, gdnative, and nativescript. it's a very difficult process as the only real tool to debug cgo is gdb as lldb gets confused when stepping through the go code. i could probably write a medium article on the hurdles and hardships i went through to get the project where it's at. |
Would love to help you maintain a new godot-go repo. |
Description
I started using godot-go recently and I gotta say - the work you've done here is amazing and I'd love to contribute and make it more stable - that saying, I have a problem I can't figure how to solve.
The bindings work fine but for some reason, the
AnimationPlayer
element is behaving odd.Calling
.Play()
or.GetCurrentAnimationLength()
seem to behave as if thegd.Real
parameters and return values map to 0.Things I've tried doing with no success:
.Play()
onAnimationPlayer
andAnimationPlayerImplementer
to acceptgd.Float
instead ofgd.Real
gd.Float
underlying type befloat32
instead offloat64
I've created an example project repo for convenience:
https://github.com/mastern2k3/godot-go-animtest
Would love help on this or maybe a new thread to follow, thanks in advance!
Details
go version go1.11 linux/amd64
3.1.stable.official
master branch "1746202"
Linux Mint 19.1 linux/amd64
The text was updated successfully, but these errors were encountered: