- Home /
acessing vector coordinates that are stored in a variables
OK so here is my theory if i get the objects current position say, ( 5.2, 0, 2.3) and store it in a variable i can the pull that variable up later and edit it when i press one of the arrow keys, say like this ( 6.2, 0, 2.3) which will in theory move on the x axis thus moving it forward. Ive gotten to the point were i have edited the variable and printed both the current position and the position i want to move to when i press the up key , but the problem is how do i move this object from ( 5.2, 0, 2.3) to ( 6.2, 0, 2.3) when it's edited position is stored in a variable? as you could tell i need it to be a variable because this position is constantly changing .. any help would be greatly appreciated
how do i tick? i though i done it before but appearently not :O
Ok, since this is the 3rd time someone really wants to tick an answer but doesn't know how, i made an image :D
oh well why isnt it called ticking ins$$anonymous$$d of clicking
Because ticking is the process of "settinng" the tick-mark to make something "ticked", but to do so your have to "click" the tick-mark. This should be a tutorial on how to tick an answer and you actually have to click the tick-mark to do so. Sounds complicated and it seems it really is. :D
its not that its difficult bro its just how was i suppose to figure out that that little check mark below the thumbs up and thumbs down was the tick button.. it should be labeled or something. and if iam missing something give me a break Ive only been on the site for more then a week and havent touched it in 7 days.
Answer by Fattie · Sep 07, 2012 at 07:55 AM
um ...
// save the position
handyPosition = transform.position
// chane the position if you happen to want to
handyPosition.y += 69;
// move the object immediately to some position
transform.position = handyPosition
// more tricks ... make a "delta"
delta = Vector3( 6,9,-1 );
// move the object immediately y that delta
transform.position -= delta;
is that what you need to know? hope it helps
game engines make game development amazingly simple!