Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: yunybollicao on Sun 15/05/2011 17:56:41

Title: Problem using "if" in script
Post by: yunybollicao on Sun 15/05/2011 17:56:41
Hello everyone, I have to say that before to write here I read and search at the forum and manual and I didn't found the answer to my question.

In my game there is a security camera in one of the rooms, and I'm trying to make it move facing the player everytime that he walks inside the room.
At first I thought that I could use "if" player walks to a place, then the camera will use "facecharacter", but i don't know why It doesnt work.

I'm sure that I am not writing it well...

if (player.Walk(400, eNoBlock)){cCamera.FaceCharacter(cEgo);}

----

If anyone can help or knows another way to script this, i'll be very greatful  :)
Thank you for advance!
Title: Re: Problem using "if" in script
Post by: Matti on Sun 15/05/2011 18:06:39
Player.Walk is a command, you can't put that in a condition..

You could use a region and its WalksOnto function though:


function region1_WalksOnto()
{
cCamera.FaceCharacter(cEgo);
}


..and welcome to the forums!