-
Notifications
You must be signed in to change notification settings - Fork 6
Prefabs
Swifter edited this page Feb 7, 2025
·
3 revisions
- Learn about how to load bundles before proceeding.
You can access the prefabs from the bundle using the prefabs property. You might want to set that to a constant.
const prefabs = bundle.prefabsThe prefabs property will contain all the prefabs that are on your bundle.

On any given prefab, there are a few properties/functions
-
name- Simply the key of the prefab in theprefabsobject -
path- The path of the material in the asset bundle (e.g.assets/materials/myprefab.prefab) -
instantiate- Allows you to create a prefab instance of this prefab.
(difficulty, beat = 0)
prefabs.myprefab.instantiate(map, 3)You can also use an object {} to specify the id of the prefab instance and other properties.
prefabs.myprefab.instantiate(map, {
beat: 0,
id: 'myID'
})You can use the destroyable objects system to more easily manage prefab instances.
const prefab = prefabs.myprefab.instantiate(map, 3)
prefab.destroyObject(6)When using AssignObjectPrefab events, it is best to use the path property on prefabs you want to use instead of finding it manually.
rm.assignObjectPrefab(map, {
colorNotes: {
track: 'myColorNotes',
asset: prefabs.mycolornote.path
}
})This will ensure if the path of the prefab changes, your script will automatically accommodate.
- Info
- Difficulty
- Beatmap Objects
- Gameplay Objects
- Walls
- Basic Notemods
- Note Iterators
- Basic Events
- V3 Events
- Custom Events
- Heck Tracks and Animation
- Easings
- Point Types
- Point Utilities
- Heck Animation Baking
- Heck Animation Settings
Non-Vivify Models
Vivify