Has anyone ever tried swapping the textures used by a projector? As in an animated swap during the game? I would be keen to know if this is possible.
Cheers
AaronC
Has anyone ever tried swapping the textures used by a projector? As in an animated swap during the game? I would be keen to know if this is possible.
Cheers
AaronC
Try this:
var newTexture : Texture;
function Start ()
{
SwapTexture (newTexture);
}
function SwapTexture (swap : Texture)
{
var projector = GetComponent (Projector);
projector.material.SetTexture ("_ShadowTex", swap);
}
Maybe you could use a MovieTexture…?
Not in unity indie I’m afraid…
Thanks Daniel, that works. Its kinda freaky when you stop playing the scene and it doesnt revert to the texture before pressing play, like that setpixel script which permanently draws into the texture…
I have a vision of using animated blob shadows under a character, to create a character shadow that moves, that doesnt require pro.
Thats a great start Daniel, thanks.
AaronC