Author Topic: Spawning invisible brick via code [Solved]  (Read 1699 times)

I want to spawn a brick as invisible, but
Code: [Select]
%brick.setRendering(0); only makes it disappear after it flashes white. Is there any way to remove the flash? Or do I need to spawn something other than a brick?
« Last Edit: April 07, 2013, 07:46:42 PM by tommybricksetti »

Flashes white? I don't think that's something you're able to fix, I think that's how the brick renders before all the settings are put in place. Show us the whole script?

Code: [Select]
//Brick
function Player::SpawnABrick(%obj)
{
if(%obj.isHanging)
{
%pos = vectorAdd(%obj.getTransform(),"0 0 0.1");
}
else if(!%obj.isAnim && %obj.isClimbing)
{
%pos = vectorAdd(%obj.getTransform(),"0 0 -0.95");
}
%obj.BrickDelete();
%brick = new fxDTSBrick()
{
datablock = brick2x2fData;
position = vectorAdd(%pos,"0 0 -0.35");
isPlanted = 1;
colorID = 0;
};
%brick.plant();
%obj.isBricking=1;
%brick.setTrusted(1);
%brick.setRaycasting(0);
// %brick.setRendering(0);
%obj.defaultBrick = %brick;
if(!isObject(BrickGroup483))
{
new SimGroup(BrickGroup483)
{
bl_id = 483;
name = "HangBrick";
};

MainBrickGroup.add(BrickGroup483);
}
BrickGroup483.add(%brick);
}
function Player::BrickDelete(%obj)
{
if(%obj.isBricking)
{
%brick = %obj.defaultbrick;
%obj.isBricking=0;
%brick.delete();
}
}

Don't think this is something you can change.

Did you try setting the isRendering field to false when creating the brick?

You could try putting an invisible staticShape under the player.

Try editing the color set and adding a completely transparent color. Then when creating the brick set it to that color idx. Maybe that will remove it?

You could try putting an invisible staticShape under the player.
How exactly

Try editing the color set and adding a completely transparent color. Then when creating the brick set it to that color idx. Maybe that will remove it?
Completely transparent colors do not work anymore since the shaders update. The brick texture on it still glows in the light

I am aware, but im saying since rendering doesn't get rid of the white preview, set it completely transparent then render it?

Setting the bricks rendering to 0 'disappears' as fast as spawning an invisible brick.
So you would still see the white flash.

But what if you set it as the brick is created?
Did you try setting the isRendering field to false when creating the brick?

Like this:
Code: [Select]
new fxDtsBrick(blah) { isRendering = false; };
Would that work?
« Last Edit: March 22, 2013, 11:59:08 PM by Greek2me »

This isn't possible without changes from Badspot's end.

This isn't possible without changes from Badspot's end.
thank you

I tried using a static shape, but it's really not working. Any ideas on how to create a nonStatic shape that is invisible?