Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: doctorhibert on Sun 26/02/2017 12:58:41

Title: How to make the player character look at the character he's talking to
Post by: doctorhibert on Sun 26/02/2017 12:58:41
So if I interact with a character, my PC just uses the talkingview of the last walkingview he was in. So if he needed to walk up to get to the character he wanted to talk to, the talkingview would just be his back. How do I make him look to wherever the character is?

I'm using the BASS template, if that changes anything
Title: Re: How to make the player character look at the character he's talking to
Post by: Slasher on Sun 26/02/2017 13:02:14

Example
Code (ags) Select
cEgo.FaceCharacter(cMan);
Title: Re: How to make the player character look at the character he's talking to
Post by: Cassiebsg on Sun 26/02/2017 13:03:51
you can use:
Code (ags) Select

player.walk(character.x-10,character.y+1); // Note the -10 and +1 are just random cords, to add/subtract from the character's coords. adjust them as you see fit.
player.FaceCharacter(character);
//remaining of talk code


EDIT: slasher the flash, beat me to it. (laugh)
Title: Re: How to make the player character look at the character he's talking to
Post by: doctorhibert on Sun 26/02/2017 13:58:13
Well that was a lot easier than I expected. Thanks