Render to Texture

31.  Select the python script named
  • Logic Editor >> Controllers >> Python Controller
  • Script >> Script List >>
  • Earlier, we opened in the Text Editor 
  • That added to the game engine's python script list
32.  Add a game property to Monitor
  • Logic Editor menu >> View >> Properties
  • Properties tab >> Add Game Property button
  • We are adding the material name as a python variable (a game property).
  • This way we can use one (and only one) python script for ALL of the Render To Texture objects in the game.
33. Property Name: material  --  Property Type: String
  • Logic Editor >> Properties tab >> Property Name: material
  • Logic Editor >> Properties tab >> Property Type: String
  • The string Game Property must be named material.  
  • The code in looks for a string Game Property named material.