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

Creating a CollisionPolygon2D from a Sprite has an incorrect offset is done from a Sprite with Region enabled #43887

Open
Tracked by #45334
IoneGod opened this issue Nov 26, 2020 · 2 comments

Comments

@IoneGod
Copy link

IoneGod commented Nov 26, 2020

Godot version:

Godot 3.2.4 beta 2

OS/device including version:

Windows 10 , Core i5 , 6gb Ram , Intel Hd graphics card with Nvidia Geforce 920m/pcie/SSE2
Issue description:

sprite problem
When I used the Sprite option Create CollisionPolygon2D sibling the result is shown on the left the expected result is shown on the right. This happened when I used a sprite with Region set to true and Auto slicing option selected. The collision shape became offset from the position of the sprite
The original sprite was :
GreenArrow@2x0

And my sprite was also rotated -90°

Steps to reproduce:

Put the second image provided above into a sprite, set the sprite Region option to true and use Auto slicing for the texture region and chose any auto sliced sprite . Then click on the sprite options and create a Collision Polygon Sibling for the sprite you should get a Collision Polygon offset from the position of the sprite by the same amount the auto sliced sprite is offset from the bounding box of the entire sprite as shown below
problem04 - Copy

Minimal reproduction project:

Sprite offset Problem.zip

@Calinou Calinou changed the title Sprite create 2d collision polygon problem Creating a CollisionPolygon2D from a Sprite has an incorrect offset is done from a Sprite with Region enabled Nov 26, 2020
@Calinou
Copy link
Member

Calinou commented Nov 26, 2020

@IoneGod Please upload a minimal reproduction project to make this easier to troubleshoot.

@IoneGod
Copy link
Author

IoneGod commented Nov 27, 2020

@Calinou I have uploaded a minimal project

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

3 participants