Skip to main content
Participant
February 28, 2025
Question

Script error

 hello everyone I have this error that I can’t seem to find on how to fix it, any help will be much appreciated. Thanks

3 replies

PigeonNo12
Honored Contributor
February 28, 2025

See SassyNoodle reply about a missing module.

Also, in case you need it, make sure to also activate the avatar_ai_agent' API following these steps:

1) Go to the scripting menu

2) Open the settings (gear icon)

3) Click on the API tab

4) Scroll down and toggle on the horizon/avatar_ai_agent option

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours
Participant
February 28, 2025

The error indicates that you are missing the script you're trying to import. It appears you've gotten this code from the documentation and are missing the NPCAgent.ts file. You can grab the code here: https://developers.meta.com/horizon-worlds/learn/documentation/desktop-editor/npcs/npc-scripts

Be sure to enable the horizon/navmesh API as well as the horizon/unity_asset_bundles API since NPCAgent.ts requires it.

PigeonNo12
Honored Contributor
February 28, 2025

Oh good call! It looks like that's a module, not the API

Upcoming Events : Build with a Mentor: Custom UI Thursday 3/20 at 5:00 PM PT Register March calendar of all Mentor Workshops and Office Hours