-
Notifications
You must be signed in to change notification settings - Fork 94
facing
Jan Boon edited this page Mar 12, 2023
·
4 revisions
title: Facing description: published: true date: 2023-03-12T14:12:53.959Z tags: editor: markdown dateCreated: 2023-03-12T14:12:53.959Z
The facing native AI script function is used to change the orientation of an NPC to face a particular direction or another NPC.
()facing(direction: f) // facing_f_
()facing(group1: c, botname1: s, group2: c, botname2: s) // facing_cscs_
- direction (float): The new angle of the NPC in radians.
- group1 (context): The NPC group of the bot that will turn towards the other bot.
- botname1 (string): The name of the bot that will turn.
- group2 (context): The NPC group of the bot that the other bot will face.
- botname2 (string): The name of the bot that the other bot will face.
()facing(3.14);
This example code sets the orientation of the current NPC to 3.14 radians.
(@group1)group_name1.context();
(@group1)group_name2.context();
()facing(@group1, "bob", @group2, "bobette");
This example code sets the orientation of the NPC named "bob" in group "group_name1" to face the NPC named "bobette" in group "group_name2".