1

What i want to do:

If player/ avatar is close to an object, objects texture changes to a higher rez one/ object changes material.

  • How to get distance between two objects using script?
  • How to apply/change texture to an object using script?
EwwGin
  • 142
  • 3
  • 14

1 Answers1

3

You don't even need to write python code, you can change the material with level of detail (LOD)

enter image description here

Create different objects (or duplicate the same mesh Shift-D if don't want lower polygon count)

  • Assign the textures to the objects -
  • And all to the highest resolution object as LOD objects.
  • Adjust the distance for where they should be displayed.
  • Move all but the highest resolution object to an invisble layer.

The effect is visible in the viewport:

enter image description here

A python soultion would be to combine snippets from:

stacker
  • 38,549
  • 31
  • 141
  • 243