Author Topic: Placing a brick directly atop another brick server-sided.  (Read 416 times)

I'm no good at vector math, how would I do this?

ie. put a 1x1x1 brick atop a x4 cube

randomly on top, or where specificaly?

randomly on top, or where specificaly?
Exactly atop the brick as exactly as possible aligning to the grid.

Disregard the example in the OP and let's pretend it's a x4 cube atop another x4 cube.

Exactly atop the brick as exactly as possible aligning to the grid.

Disregard the example in the OP and let's pretend it's a x4 cube atop another x4 cube.
oh, that's better
i just don't remember how to though

I'm not sure exactly what your problem is, but I'm guessing it has to do with the brick not always being in the correct place on the Z axis with different height bricks?

i think he wants to find the coordinates of the first brick, then add to the Z to build on top

I had this problem with the bricktext event, I needed the StaticShape to always be a little bit above the top of the brick
Here's what I set for position inside the 'new StaticShape...' :
Code: [Select]
position = vectorAdd(%this.getPosition(),"0 0" SPC %this.getDatablock().brickSizeZ/9 + "0.166");
Maybe that, minus the '+ "0.166"' with %this being the brick your building on top of?
« Last Edit: September 13, 2011, 09:53:32 PM by Headcrab Zombie »

That helps a lot, it was exactly what I was looking for, thanks!