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

Godot 3.3 Wrong rotation pivot for bone in Skeleton2D #48348

Closed
kyoz opened this issue May 1, 2021 · 10 comments
Closed

Godot 3.3 Wrong rotation pivot for bone in Skeleton2D #48348

kyoz opened this issue May 1, 2021 · 10 comments

Comments

@kyoz
Copy link

kyoz commented May 1, 2021

Godot version:
3.3 Stable

OS/device including version:

  • MBP 2015 15"
  • Artix with Runit
  • Both GLES2 & GLES3

Issue description:
When update to Godot 3.3, all of my animation work incorrectly. It's seem bone in Skeleton2D got the wrong pivot rotation in Godot 3.3

Steps to reproduce:
untitled

Minimal reproduction project:
godot3.3_rotation_issue.zip

@lawnjelly This is what i'v talk about

@lawnjelly
Copy link
Member

lawnjelly commented May 1, 2021

Ok I'll take a look. 👍
In the meantime if you switch rendering/2d/use_software_skinning to off it should work (providing your hardware supports it).

@lawnjelly
Copy link
Member

lawnjelly commented May 1, 2021

I've figured out what seems to be causing the problem. If you look in the Node2D that the polys are hanging off of, it has a translate on it. The software skinning doesn't seem to like this. If you set the translate of the Node2D to 0, 0, and move the polys in the editor to match up to the bone positions, then rotate the bones then it works.

This is probably a transform I'm not taking account of as it wasn't in the test projects I had. I'll see if I can fix it.

@kyoz
Copy link
Author

kyoz commented May 1, 2021

Yay, Thank you so much, @lawnjelly , now i can continue working on my project 👍

@lawnjelly
Copy link
Member

It is a bug, but once you know what causes it, it is workaround-able. You didn't need to rebind the bones, I just tested it, just change the translate of the Node2D and the polys.

@kyoz
Copy link
Author

kyoz commented May 1, 2021

Thank @lawnjelly , Btw, i do have a small question, when creating a Scene that i need to create other instance and reuse it. Such as Mob scene for random enemy spawing. What is good position to place the Mob in the character. I do see some one put in center the scene, some put it just center to horizontal & vertical lines.

Thank you very much

@lawnjelly
Copy link
Member

Are you meaning where to use as the origin for your character, I didn't quite follow, you mean Mob as in mob of bad guys?

I don't think it matters as far as the engine is concerned (possible it could affect culling I guess?), so I would use what works for you. For the origin of 3d characters I usually use the centre of where their feet are, I've never used 2d skinning in a game. 🙂

@kyoz
Copy link
Author

kyoz commented May 1, 2021

I mean
Is placing the character center the x and y axis or center of the game screen is a good practice?

Like this guy doing, i'v alway doing this way, that's why i move the Node2D, haha

@lawnjelly
Copy link
Member

Yeah I think that is fine, I think a lot of people use the centre, especially with using a RigidBody (a lot of deciding depends on how you do physics). Whatever works in your game, there are no strict rules. 🙂

@lawnjelly
Copy link
Member

I've worked out a fix for this, just need to tweak the PR a tiny bit to work with several skeletons batched together. 👍

@akien-mga
Copy link
Member

Fixed by #48402.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants