horrorKit.package
This package holds more than this page lists. See all of its files in its world.
README.md
horrorKit.MonsterPen
Keeps one monster inside a box. Put it on an empty entity in the middle of a pen, set monster to the monster entity's name and extents to the pen's half-size: whenever the monster is found outside the box it is put back where it started (on the peer that owns it, with its navKit agent warped too). Build the pen with real walls the monster's nav map cannot cross (1 m thick or more on a 0.5 m grid map); this is the guarantee on top, so a visitor at the rail is never reached. The showcase room and the kit gallery use it on every pen.
local guard = entity.spawn("penGuard")
guard.position = vector.create(7, 1.5, 86)
guard.component.add("horrorKit.MonsterPen", { monster = "penMonster", extents = { x = 3.6, y = 3, z = 1.6 } })
Fields: monster, extents, every (seconds between checks). Event: returned { monster }.