Moving player to object

Started by MovieGuy13, Mon 27/04/2009 14:13:00

Previous topic - Next topic

MovieGuy13

I know this will sound stupid, but how do you move a character to an object(not hotspot) when you interact with it?  I haven't used AGS in a while and the knowledge base doesn't work for me(don't know why). So please!

Khris

Code: ags
  player.Walk(147, 120, eBlock);


You could use the object's coords and width to make him automatically approach the object, too.

And please read the manual.

MovieGuy13

Quote from: KhrisMUC on Mon 27/04/2009 14:17:18
Code: ags
  player.Walk(147, 120, eBlock);


You could use the object's coords and width to make him automatically approach the object, too.

And please read the manual.

I did this and it tells me it expects "[".
Sorry for not reading the manual, I couldn't find that topic in it, but will search more

Gilbert

For the [ problem, did you use the word object, or character, in your script line? They are arrays, so you have to provide an index in brackets.
For example, if you want the player approaches object 4 in the room you have to write:
Code: ags

player.Walk(object[4].X, object[4].Y, eBlock);



SMF spam blocked by CleanTalk