Module: npc_ai

Non-player character add-on. Provides animated moves for NPC with a specified behavior.

Summary

Members

Methods

Detailed Description

Members

NT_FLYING

NPC movement type - flying.
Type:
  • Number
Source:

NT_SWIMMING

NPC movement type - swimming.
Type:
  • Number
Source:

NT_WALKING

NPC movement type - walking.
Type:
  • Number
Source:

Methods

disable_animation()

Removes all sensors attached to animated objects and stops animation
Source:

enable_animation()

Attaches sensors to characters and runs elapsed_cb every frame.
Source:

new_event_track(graph)

Creates a new event track based on a given graph.
Parameters:
Name Type Description
graph Object Animation graph with a number of movement params.
Properties
Name Type Description
path Array A list of [x,y,z] points NPC will be moving around.
delay Number Time delay before each path step.
actions Object3D Actions for every movement type (move, idle, etc).
obj Object3D Animated object ID.
rig Object3D Armature object ID.
collider Object3D Collider object ID which will be used for collision detection.
speed Number Movement speed.
rot_speed Number Rotation speed.
random Boolean Determines whether the object will perform random moves or not.
type Number NPC movement type (NT_WALKING, NT_FLYING, etc).
Source: