11 ManagingAgentsAnimation - project-SIMPLE/simple.toolchain GitHub Wiki

Management of agents’ animation

Link to the example model: LinkToUnity/Models/Code Examples/Manage Animation for Agents.gaml

ezgif com-optimize-3

The general principle is to modify from GAMA the parameters of an animator or sent triggers to it. It works both for geometries/agents (sent to Unity using add_geometries_to_send) and other player agents (player_unity_properties).

Animation

The triggering of an animation is done using the action "update_animation" of the Unity Linker.

ask unity_linker {
	do update_animation(
		players: unity_player as list, //list of players to send the information to
		geometries: boy_agent, //list of geometries/agents to update the geometry to - these agents should have been sent to Unity using add_geometries_to_send
		parameters: ["MoveSpeed":: 1.0], //list of parameters to send to trigger animation - key(string): name of the parameter, value: either a float, an integer or a boolean
		triggers: []//list of triggers (string)
	);
}
⚠️ **GitHub.com Fallback** ⚠️