- Home /
How the player can translate 1 "unit" and not smouthly.
that i want is to move the player between cubes (1.1.1)
and be in the center of the cube.
let me draw it ^^
this could be possible with Vector3 ??
Answer by Jesse Anders · Nov 20, 2010 at 01:09 PM
I would just set the position of the player directly, e.g.:
transform.position = <...position that you want to move the player to...>;
You could move the player relatively (e.g. using Transform.Translate()), but it's at least a possibility that this could introduce numerical error over time. This is probably unlikely to happen if the centers of the squares fall on integer coordinates, but if you simply assign the new position directly, you won't have to worry about it.
no i want the player to move every time i press the button for 1 unit per second...
when i use this code the player move smoothly but i want i snap to the next point
if (Input.Get$$anonymous$$ey ("up")){ transform.Translate(Vector3(0,0,1)); }
I guess I don't understand your question then. Is it Get$$anonymous$$eyDown() that you're looking for?
Answer by NikSpace · Nov 20, 2010 at 04:46 PM
i find it... i am not really sure how it work. i read the code and confuse me a little but is what i was looking for..
is a code for 2D move
but still is not what i am looking for exactly :/
I want to make a snake game 2.5D has anyone had done this?