I have very little experience with interactive NPCs/non-player humanoids.
I am making a new game in which players would have access to a garage. I am looking at adding an NPC to the garage, in which this NPC would do the following:
-
Wave at the player, in a loop, as long as the player is within range of the NPC and hasn’t interacted with the player yet (interaction would be through a ProximityPrompt which I have experience with). The NPC waving at one player would not be seen by other players that are not within range, unless other players also came within range. I am aware that this would require a local script at the very least, which I have experience with, and mild animating, which I don’t have much experience with, but it would be a simple animation that I could definitely figure out myself.
-
Stop waving at the player once the player triggers a ProximityPrompt that would be in the NPC’s torso, and a GUI would spawn (this is how players would spawn vehicles). NPC would just stand there while the player does whatever on this GUI. Once the player has closed the GUI by either spawning a vehicle or otherwise closing the GUI, the NPC would once again go back to waving at the player.
-
The entire time the player is within range of the NPC, the NPC would angle/orient itself towards the direction of where the player is moving/coming towards. For example, if the player is coming head on to the NPC but suddenly makes a slight right, the NPC would orient itself towards the player’s right, which would be its left. Once again, the NPC would only do this for the individual player, so if there is one player on its right and one on its left, the NPC would be facing the respective direction for each respective player. I am aware that this would require some usage/knowledge of CFrame angles which I don’t have a whole lot of, and I assume that this would also need raycasting to determine where the player is coming from? I may cut out this requirement since it is pretty complex and probably unnecessary, but it would be cool.