Entity/SetupPhonemeMappings

From Garry's Mod
Jump to: navigation, search
 Entity:SetupPhonemeMappings( )

Contents

Description

Initializes the class names of an entity's phoneme mappings (mouth movement data). This is called by default with argument "phonemes" when a flex-based entity (such as an NPC) is created.

Arguments

string fileRoot

The file prefix of the phoneme mappings (relative to "garrysmod/expressions/").

Examples

Example

Defines a function that can enable or disable phoneme mappings on an entity.

-- Turn phoneme mappings on or off
function EnablePhonemes(ent, on)

	if(!IsValid(ent)) then return end
	
	if(!on) then
		-- Disable mouth movement
		ent:SetupPhonemeMappings("")
	else
		-- Enable mouth movement
		ent:SetupPhonemeMappings("phonemes")
	end

end


Personal tools
Navigation