Object movement algorithm
Hi well , i am working on a game and its about avoid blocks, now i have being working on level 1 and level2 , and it seems that i work too hard, i throw blocks that goes through the middle , and to build it takes me forever , i set position, then if(transform.position.x <= ... && transform.position.y == ...){ vector3d.right*speed*Time.deltaTime} thats how i make blocker move.. and sometime in another screens its goes wrongly but its a minor bug cuz it almost never happen , which means the block goes in straight line on axis X , from left to right or right to left , i need to throw him like 6 time in the first level, so i check it every time and it takes me 6 hours for 1 level!, there is any way to make it easier? Thanks for the help! will appriciate a good way to make it easier.
Btw i am newb with unity , i am working with unity for like 3 weeks till now, i am just learning the engine , so excuse me if i am stupid about things..
Sorry, I am a little confused on the type of game you are creating is it like an inverted 'catch' game? Objects fall down the screen and ins$$anonymous$$d of catching them you are avoiding them?
I got a character in the middle its 2D , so its spining stick, think of spining stick and i throw at him blocks and you need to avoid them by touching the screeing if you touch the left side its spining left and if you touching right its spining right, and you need to avoid the blocks. my problem is at throwing the blocks its so hard to make the objects move from left to right, so i ask you if you know a way to make an object , kind of enemy ai , thats sprites goes from one position to the next with speed that i choose.
I think I got it, but do you have your current block script handy? Showing it might help getting your intent.