Hello Dev’s,
So I wanted to add some realism to my game by adding face gestures to the player when they talk (Basically Making the face change when the player has chatted something). But I don’t know how to do any of that. I get how to do the player chat stuff but not the it works with anything the player says. Please help!
You’ll need a custom character and you’ll need to perhaps create a custom joints system. You’ll need to learn about IK and a lot of math.
Depends on how complicated you want to make this you could make a massive script with a bunch of string.{} stuff, based on each letter you could make the face change (Probably would want to load all the decals beforehand on the client’s side so the face doesn’t go blank between each change) Or you could just have like 3-4 Decals that change randomly based on however long the string is
You could use decals on the character’s head,
I must of used the word gestures. But what I meant was when the player chats something and sends it the players face changes. Sorry for the confusion
Try to plan your code on a sheet of paper, then try to write pseudo-code. Would help a lot as this is an advanced project.
As stated you can add a few decals to each players HeadMesh, make all except the idle image transparent, then you should be able to use a script to ‘animate’ them by turning each one visible and transparent momentarily when the player chats.
this is a really good idea. I must congratulate you. I’m sure it will make the characters more realistic, but you may need a custom character, you can also detect the speech and take the string of the text in the speech and change the character accordingly. but i’m sure you will need really good string knowledge. If you want to know how to perceive speech, I can give an example here.
player.Chatted:Connect(function(msg)
print(msg)
end)
this will print , what player said in the chat
hope this helps and goodluck with your game!
I remember someone actually made a module for this very purpose. I will link it here if I can find it since I was also interested in having face gestures for a TTS system I was trying to make.
They had mouth and eyes that you can put on your character.
I managed to find the place.
It is uncopylocked so you can simply download the script and the decals there
https://www.roblox.com/games/845260657/ROBLOX-Facial-Animation-Expression-Pack-v1-3
Adding onto this, You could make something a bit more complicated
Example
player.Chatted:Connect(function(msg)
Var1 = msg:lower()
Var2 = string.split(Var1," ")
-- Now at this point you will have a lowercase version of the players message, And at that you have it split so you can better read each part of it
-- Let's say the player says "Hello There" you can now depending on the position of the words you can extract text lets do that
print(Var2[2])
-- This will print the second word in the string
-- you can add more to this by going into each word and based on the letters in it use different decals for the face
end)
I know how to make it with your normal starter character. I just need to know how to make it detect anything the player says