Game Development Community

Dynamic Material

by Richard_H · in Artist Corner · 02/13/2007 (3:02 pm) · 2 replies

I'm trying to add an object which can dynamicly change it's texture. My object is named "Planet" so I named the material BASE.Planet and the texture BASE.Planet.png. I then used
function Planet::onAdd(%this, %obj)
{
	%obj.setSkinName("Splotchy");
}
to set the texture to Splotchy.Planet.png, but nothing changed and it didn't report an error.
What am I doing wrong?

Edit:
The first texture works fine, but when I change it nothing happens.

#1
02/14/2007 (9:05 am)
It turns out base should be all lowercase, it works now!
Yay!
#2
02/20/2007 (8:58 pm)
Ah! You solved my problem. Thx!