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

Animate complete function is called earlier than expected when animating euler property #7253

Closed
dmkondr opened this issue Jan 4, 2023 · 1 comment · Fixed by #7540
Closed
Assignees
Labels
bug Something is not working as expected engine Issues related to the Defold engine

Comments

@dmkondr
Copy link

dmkondr commented Jan 4, 2023

Describe the bug (REQUIRED)
Animate complete function is called earlier than expected when animating euler property

To Reproduce (REQUIRED)

go.animate(".", "euler.z", go.PLAYBACK_ONCE_FORWARD, 90, go.EASING_LINEAR, 1, 0, function()
	print(go.get(".", "euler.z")) -- prints 88.xxx or 89.xxx

	timer.delay(0.1, false, function()
		print(go.get(".", "euler.z")) -- prints 90
	end)
end)

Expected behavior (REQUIRED)
I expect the complete function to be called the same frame when euler property reaches its target value

Defold version (REQUIRED):

  • Version 1.4.1

Platforms (REQUIRED):

  • OS :Windows 11
@dmkondr dmkondr added the bug Something is not working as expected label Jan 4, 2023
@britzl britzl added the engine Issues related to the Defold engine label Jan 5, 2023
@britzl
Copy link
Contributor

britzl commented Jan 5, 2023

I'm actually not getting 90 degrees when testing your example. I get the same value in both cases (around 89.2). The thing is that the euler property is "fake". We never really use it internally and always convert to from a quaternion rotation. I'm still a bit surprised though that it seems like the precision is fairly low and that you are getting something like 89.2 degrees when rotating to 90.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants