# Material - Modifiying Object's Scale Using ObjectScale

**URL:** <https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662>\
**Category:** Rendering\
**Tags:** vertex, unreal-engine, scale, question\
**Created:** [April 10, 2016, 5:10pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662 "2016-04-10T17:10:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vithar7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vithar7](https://forums.unrealengine.com/u/Vithar7)\
**Post date:** [April 10, 2016, 5:10pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/1 "2016-04-10T17:10:29Z")

</div>

![86224-objectscale.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/1/7/e17ce9534d1a0c901b473bdd91b6aad63619e72f.png)

I’m trying to write a vertex shader that will scale an object down programmatically. Can this be done using the ObjectScale function? I tried this basic shader, but it doesn’t affect the object’s scale.

---

<div class="post-metadata">

**Author:** ![ViceVersa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ViceVersa](https://forums.unrealengine.com/u/ViceVersa)\
**Post date:** [April 11, 2016, 1:01pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/2 "2016-04-11T13:01:20Z")

</div>

I havent used object scale before, bit im pretty sure what your doing will scale a texture (which you dont have) with the scale of the object. I dont think you can do that in the material editor, do it in the blueprint of the object

---

<div class="post-metadata">

**Author:** ![Minty597](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Minty597](https://forums.unrealengine.com/u/Minty597)\
**Post date:** [March 27, 2017, 9:54am UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/3 "2017-03-27T09:54:04Z")

</div>

Take the objects world position, subtract the Absolute world position and multiply the result by a value.

I use the sine of time to make it pulse back and forth.

Wire all that into World Position Offset.

 ![131781-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/0/3b0e75b713a43a7f56f192a548d04959a9565c4a.png)

---

<div class="post-metadata">

**Author:** ![anon94551974](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon94551974](https://forums.unrealengine.com/u/anon94551974)\
**Post date:** [October 20, 2017, 11:11am UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/4 "2017-10-20T11:11:17Z")

</div>

Object scale gives you the scale that the object already have in your level editor.  
If your object scale is 1,1,1, it will be white, 1,1,0 will be yellow etc… Values over 1 will become emmisive if you plug it to the emissive node. (10,10,0): emissive yellow. It does not make sense to scale an object in the shader using this data because you have to modify the real transform of the object to modify that parameter.

To scale an object uniformly in X,Y,Z, you can just multiply a scalar value by the vertex normal node and plug it into the world position offset.

---

<div class="post-metadata">

**Author:** ![TorQueMoD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/torquemod/32/710746_2.png) [@TorQueMoD](https://forums.unrealengine.com/u/TorQueMoD)\
**Post date:** [November 3, 2021, 9:31am UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/5 "2021-11-03T09:31:31Z")

</div>

If anyone is looking to have an actor scale up or down based on the distance to the camera (or player) you can use a camera depth fade and a lerp to drive the multiply value instead of time and sine:

 ![0_ScaleMeshBasedOnDistance_Material.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/9/29e51e3081d5eddc94def42947c06d0943f739c1.jpeg)

---

<div class="post-metadata">

**Author:** ![ERaege](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ERaege](https://forums.unrealengine.com/u/ERaege)\
**Post date:** [May 22, 2023, 2:51pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/7 "2023-05-22T14:51:28Z")

</div>

Wit this method I seem to be getting some self-shadowing on the normals based on the original scale of the object. If the object grows in size, it’s not visible, but as it contracts, the normals become dark in the areas where it contracts past the origin point of the vertex.

---

<div class="post-metadata">

**Author:** ![ZacD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZacD](https://forums.unrealengine.com/u/ZacD)\
**Post date:** [May 22, 2023, 2:53pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/8 "2023-05-22T14:53:16Z")

</div>

Probably mesh distance field shelf shadowing, you could disable them on the mesh or change the bias settings for it.

---

<div class="post-metadata">

**Author:** ![ERaege](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ERaege](https://forums.unrealengine.com/u/ERaege)\
**Post date:** [May 22, 2023, 3:06pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/9 "2023-05-22T15:06:51Z")

</div>

Hmm, not sure how to turn them off, but changing the bias didn’t seem to affect the objects. I’ve currently got just an HDRI lighting the scene, which doesn’t seem to have any Distance Field Shadow properties either, as other lights seem to.

---

<div class="post-metadata">

**Author:** ![ZacD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZacD](https://forums.unrealengine.com/u/ZacD)\
**Post date:** [May 22, 2023, 3:40pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/10 "2023-05-22T15:40:29Z")

</div>

You can set **Distance Field Resolution Scale** to 0 to turn it off on a static mesh.

---

<div class="post-metadata">

**Author:** ![ERaege](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ERaege](https://forums.unrealengine.com/u/ERaege)\
**Post date:** [May 22, 2023, 4:33pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/11 "2023-05-22T16:33:39Z")

</div>

Ah, I see it. Did not seem to fix it though.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/4/a34a505a80c60571176209d0d93db68b4752f92b.jpeg)  
To illustrate, I am squashing this sphere on the x-axis. In the areas where it shrinks past the vertex origin point, it will shadow it. Doing something like turning off the shadows fixes the issue, but naturally that’s not what I’m looking for. Your suggestion seemed like a good one, but not sure why it had no effect.

---

<div class="post-metadata">

**Author:** ![ERaege](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ERaege](https://forums.unrealengine.com/u/ERaege)\
**Post date:** [May 22, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/12 "2023-05-22T18:15:44Z")

</div>

Switching off raytracing fixed the issue, though I’m not sure why. For some reason, Raytracing is causing this.

---

<div class="post-metadata">

**Author:** ![Juu5o](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juu5o/32/545758_2.png) [@Juu5o](https://forums.unrealengine.com/u/Juu5o)\
**Post date:** [November 13, 2025, 7:28pm UTC](https://forums.unrealengine.com/t/material-modifiying-objects-scale-using-objectscale/353662/13 "2025-11-13T19:28:25Z")

</div>

I found this thread earlier today when I was facing the same issue in my project in version 5.6.1, but after updating the project to 5.7, the issue is gone! 🥳
