0
Not a bug
Spin image from center only works in preview
I'm trying to rotate an image about its center. On the left, the flame shows in preview, rotating about its center. On the right, the flame in gameplay, rotating around an unknown transformation point.
Any ideas what I'm doing wrong here? Preview works as expected. I've taken a look at Card_Arrow to see how that does spinning, but I can't see what I'm doing differently.
The shader:
Sprite:
Material:
Customer support service by UserEcho
Possibly related, I'm seeing a NullReferenceException somewhere along the way.
1. The NullReferenceException you posted, you can ignore it always. It is just a unity's editor GUI issue, which will not affect using of Shader Weaver at all.
2. I tried the shader file in Unity2017.3f3 under Windows. It works fine in play mode. Fire rotated as expected.
Pos, pivot, loopping are relative to it, but I did not see anything unusual.
Please send a minimum project with resources to JackieLo@aliyun.com. This project should display the problem.
Ok, will do.
Sent you the files. Aside from me being on Mac, another difference between my example and the Card_Arrow flame spinner is that's a mesh, and I'm using a Sprite. When I change it to a Mesh, it spins properly in play mode.
Solved. There is no bug here.
In the project you gave me. SW project used 'Default Sprite Asset_14' for Root node while Sprite Renderer in the scene used 'Default Sprite Asset_0' . Different Sprites' rects are totally different if they are in sheets.
To avoid it:
1. Make sure Root node and Sprite Renderer use the same Sprite.
2. Attach SWSpriteAnimation to Sprite Object. It will set rect at runtime.
Thank you! I understand now. :)