How can I get the actual size of a gameobject in shadergraph?

3.6k Views Asked by At

I need to get the actual size of the object within shader graph. I currently only have the Object > Scale node or the option of manually setting the size of object in runtime.

Is there some way I can easily get the size of the object (or bounds) within shader graph?

2

There are 2 best solutions below

0
esgnn On BEST ANSWER

Shader Graph 14.0.3 Object Node has,

  • World Bounds Min: Minimum value of the renderer bounds in world space
  • World Bounds Max: Maximum value of the renderer bounds in world space
  • Bounds Size: Size of the renderer bounds
2
error13660 On

To get the position and scale of your actual game object, you need a node called Object which can be found under Input/Scene/Object.