Codeyn

Voice Chat Mouth Animation

Recommended Posts

Hello, I was wondering if it's possible in RAGEMP, to add to player's face an animation (mouth moving) while he's talking to voice chat. I've seen it in online, on FiveM so I'm curious if it can work somehow on RAGEMP. Thanks.

Edited by Codeyn

Share this post


Link to post
Share on other sites

Im struggling to find any mouth-moving facial animation, the list is kinda confusing and I can't find the basic one.

Share this post


Link to post
Share on other sites

Sorry for diggin into this grave ;)

@Codeyn

Have you found the animation for mouth-moving? You are right, the list is confusing.
 

Share this post


Link to post
Share on other sites
Posted (edited)

It is possible. When they start talking, call this on server-side (it's from [email protected][email protected] but gender is irrelevant, the animation is the same for both - you can try changing [email protected][email protected] to check):

player.playAnimation('[email protected][email protected]', 'mood_talking_1', 1, 45);

When they stop, call this on server-side as well (change mood_normal_1 to the player's current mood, if you use a mood system or something like this):

player.playAnimation('[email protected][email protected]', 'mood_normal_1', 1, 45);

I'm using something like this to simulate this on text chat (the function is NOT evaluating if the player is currently playing another animation, that might stop all animations if they are):

// when the player speaks on chat and it's not a command, call this function
function playSpeakingAnim(player, message) {
  const secondsSpeaking = Math.ceil(message.split(" ").length / 2.5);
  player.playAnimation("[email protected][email protected]", "mood_talking_1", 1, 45);
  setTimeout(() => {
    mp.events.call("cancelAnimation", player);
  }, secondsSpeaking * 1000);
}

 

Edited by Madesoui
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.