This tutorial covers the current Homelander sample in Assets/Samples/com.cydream.homelander. The sample combines imported voxel content, scene rendering settings, and TypeScript-driven behavior.
The sample ships with:
Data/Prefab/Scripts/Use this as the reference layout if you are building a character or scene showcase with custom scripted reactions.
The sample uses two TypeScript classes:
HomelanderLaserAimBoth are exported from Scripts/index.ts and are meant to run through JsComponentProxy on the appropriate prefab objects.
HomelanderThis script watches voxel damage on the owning VoxelVolume. When the remaining solid voxel count drops below the configured threshold, it:
LaserAimThis script spawns a builtin laser gun entity, pins it in place, and steers it toward the currently controlled character or vehicle through ModAPI.
To reproduce the sample behavior:
JsComponentProxy to the object that owns the destructible voxel volume and point it at Homelander.JsComponentProxy where the laser aiming behavior should live and point it at LaserAim.VoxelVolume.manifest.asset.This sample is a useful reference for two TypeScript patterns:
ModAPI, such as voxel modification callbacks.Minimal structure:
export class Homelander {
constructor(bindTo: VX.Mod.JsComponentProxy) {
bindTo.onStart = () => this.onStart();
bindTo.onDestroy = () => this.onDestroy();
}
}
Before exporting:
npm run lint:mod -- com.cydream.homelander
Then verify: