Question by
Developer1212 · Sep 29, 2015 at 06:07 PM ·
rotationcreationformula
how would you make 2 rotated cubes at 15 degrees connected EXACTLY (javascript)
Ok guys , so I'm working on something , and it involves a rotated block creator. So here's the code for the rotated block creation :
IsBlockThere = Random.Range(0,7); //is there going to be a block there?
if (IsBlockThere != 1 ) { // if IsBlockThere is 1, there will be no block there, but if it's not 1;
Instantiate(Block, transform.position, Block.rotation);//creates the rotated Transform in the variable 'block' which I declared earlier
BlockBeenPlaced = true; // there has been a block placed
}
transform.position.x += 1;
transform.position.y -= 0.275; // the creator changes position and there it repeats this code
OK so that's the code for it but my query is about the last 2 lines of the code, how can I change the values so whenever it creates the Transform in the variable "Block", they will all be EXACTLY in line , is there a formula for this? This would be VERY useful. Thanks :D
Comment
Please answer this ASAP, I need the answer in order to continue with my first game that I'll release to the public