O'Reilly logo

Torque 3D Game Development Cookbook by David Wyand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing the material of a ShapeBase object using script

While a game is running we may want to modify the materials used by an object based on some event. For example, in a base-capture game we want the base's flag to show the current team's colors. This process of changing an object's materials is called changing an object's skin in Torque 3D. In this recipe we will modify an object's materials at any time using TorqueScript.

Getting ready

Modifying an object's materials while a game is running is very similar to skinning using the World Editor. In preparation for this recipe, please see the How to skin an object in the World Editor recipe in Chapter 2, Working with Your Editors, and set up all of the materials and the object to be skinned as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required