Hello WMs,
I have a door in my scene and if you "LeftClick" the actor "WalkTo" to this door and speaks a sentence. The same with "LeftDoubleClick" and "RunTo" with the same sentence. All works fine, but I have a question: It is possible that I set only once this sentence, because I do not want to do everything twice, because it's the same thing. I hope you can understand what I mean.
My door script look like this:
on "LeftClick"
{
actor.WalkTo(220, 621);
actor.
Talk("This door is closed!");
}
on "LeftDoubleClick"
{
actor.RunTo(220, 621);
actor.
Talk("This door is closed");
}
My idea was e.g.
var = WasClicked = 0;
and within on "LeftClick" and "LeftDoubleClick" I set the WasClicked +1
and after all I will ask if(WasClicked == 1)
{
actor.Talk("This door is closed!")
}
I don't know how I should do it. Thank you in advance for your help.