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
Fix transform issue of PhysicsSprite itself and its children #12239
Conversation
I'm not sure the solution is a proper one. @minggo @AndyQue @WenhaiLin If you think there is a better solution, please let me know |
@WenhaiLin Please review this PR |
[ci rebuild] |
|
||
return _transform; | ||
Node::onEnter(); | ||
scheduleUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible that this onEnter
method is called more than once.Schedules the update
method here may not be a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syncPhysicsTransform
method should be executed after the other scheduled callbacks is executed. Scheduler does not ensure it.
@WenhaiLin I have improved the logic with Director::EVENT_AFTER_UPDATE to ensure the transform is synced after scheduler's update. |
Fix transform issue of PhysicsSprite itself and its children
This issue still exists for normal Sprites and Nodes. |
@TheCodez It has nothing todo with normal Sprites and Nodes, the issue is attached with Physics. Can you be more specific ? |
@pandamicro I have one Sprite and a PhysicsBody set to it, this Sprite has a Node attached, which also has a its own PhysicsBody set. Now the problem is, that moving the parent Sprite won't move the child Node's PhysicsBody. This is also what is described in the forum, because he wasn't talking about PhysicsSprites but normal Sprites: |
No description provided.