Skip to content
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

Issue with tweening godot vectors #19

Closed
gamedevserj opened this issue Apr 5, 2024 · 3 comments
Closed

Issue with tweening godot vectors #19

gamedevserj opened this issue Apr 5, 2024 · 3 comments
Assignees
Labels
bug Something isn't working needs investigation Some investigation needs to be done before fixing the bug
Milestone

Comments

@gamedevserj
Copy link

gamedevserj commented Apr 5, 2024

Generic tweening doesn't work with Godot's vectors

Vector3 test;
GTween t = GTweenGodotExtensions.Tween(test, x => test = x, Vector3.One, 1f);

The error is CS0029 where it says that I can't implicitly convert Godot.Vector2I to Godot.Vector3, although Vector2I is not used in my code at all.

Hovering over parameters in tween shows that both test and x are Vector3

Generic tweening of default c# values seems to be working without a problem

@Guillemsc Guillemsc self-assigned this Apr 6, 2024
@Guillemsc Guillemsc added the needs investigation Some investigation needs to be done before fixing the bug label Apr 6, 2024
@Guillemsc
Copy link
Owner

Hey, thanks for raising this, I'll investigate and fix.

@Guillemsc Guillemsc added the bug Something isn't working label Apr 6, 2024
@Guillemsc Guillemsc added this to the v6.0 milestone Apr 6, 2024
@Guillemsc
Copy link
Owner

Hey @gamedevserj, sorry for the delay!
The getter (first parameter of the Tween function) is an action, so you need to use it like this:

Vector3 test = Vector3.Zero; // You need to initialize this or there is a compile error
GTween t = GTweenGodotExtensions.Tween(() => test, x => test = x, Vector3.One, 1f);

I'll close this, but don't hesitate to open another issue if I missed something, or it's still not working for you.

@gamedevserj
Copy link
Author

Hey @Guillemsc thanks!
Can't believe I didn't notice it 🤦
And no worries about the time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation Some investigation needs to be done before fixing the bug
Projects
Status: Done
Development

No branches or pull requests

2 participants