- Home /
Other
I want to move a block but not two
I am trying to make a puzzle game, where I have to move blocks to get to the exit. I would like to be able to move one block(at a time) but not two(at a time).
eg{ 0 is the character [] is the block : is the wall
what I want to happen with one block :0[] to : 0[]
what I want to happen with two blocks :0[][] to :0[][] (No movement) }
So what's the problem? Test whether there's only one block in front of the character and, if so, let them move it. If there's two or more blocks in front of the character, don't let the move...
There is no specific technical question for us to answer here, and we don't write scripts for you. We answer single, specific technical question to help you write your own code. And there are lots of different ways to implement the movement depending on the nature and goals of your game.
When you boil this question down to something specific, we welcome your new technical question. Including your ongoing script is really helpful for us. If this is a design question, spell out the specifics in more detail and post it on the Unity Forums.
Answer by Jeff-Kesselman · Apr 29, 2014 at 07:47 PM
As others say, this is game logic.
You need to script your game logic.
Other people are not going to write your game for you.