Verse Library verse

01 Fragment

Finds all tagged vehicle body props and applies a new material asset to instantly update their appearance.

verse-library/verse-car-material-colors/01-fragment.verse

# The one public material call: swap the whole material on a placed prop.
# (There is NO public per-parameter colour API in build 41.00.)
ApplyPaint(Paint : material) : void =
    for (Obj : FindCreativeObjectsWithTag(car_body_tag)):
        if (Body := creative_prop[Obj]):
            Body.SetMaterial(Paint, ?Index := 0)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in