Issue with rotating the object

Hey guys, so I’m attempting to use Shader to rotate the roller instead of using animator for testing purpose. But I’m not too sure why I’m getting two different behavior in the prefab and in the scene??

If you look at the gif below, the roller behave fine in the scene view, but it have completely different behavior in game view. Originally I thought I’ve set the position node to world, but turns out it was at object the whole time.

My understanding of the setup was, if I pass the position of the object to Rotate About Axis, it should rotate on the given axis on that particular position isn’t it?

I’m fairly new to Shader Graph so any thoughts on this would be appreciated.

5279457--529026--upload_2019-12-14_2-22-16.gif

Hi,

When “Static Batching” is enabled, objects of the same material that are static are combined into one mesh to save on draw calls.
To prevent this, you can either disable Static Batching under Edit → Project Settings → Player → Other Settings, or uncheck “static” on the objects.

Thanks for the reply, but I actually don’t have those objects static in my scene. In fact, nothing was static in my scene (which I should totally do to the props).

But still I tried set them to static and disable “Static Batching” in player setting. It still behaving the way I was not expecting. Maybe I misunderstood how this particular Shader would work?

Could be dynamically batched too, which does roughly the same thing as static batching, but applies to low poly non-static objects.

Well, enable dynamic batching doesn’t help it as well, its still does that when there’s more than one object with that “Rotate” material on it.

You want both Static & Dynamic batching both disabled, and the meshes not set to static.

I’ve also seen people say this is a problem when the SRP batcher is enabled, so disable that too.

Really, this would be fixed if you could set Shader Graph shaders to not be batched, which is something you can set on shaders, but isn’t exposed by Shader Graph. :frowning:

1 Like