Hology
Hology
Hology
  • 👋Welcome to Hology Docs
  • Getting started
    • Introduction to Hology
    • The first steps
    • Editor basics
      • Flying in scenes
      • Placing objects
      • Select objects
      • Transform
      • Grouping objects
      • Duplicate
    • Starter project - Third person shooter
  • Tutorials
    • Rolling ball - Gameplay programming
    • Character movement programming
    • Character AI behavior
  • Release
    • Distribution
      • Discord Activities
      • Facebook Instant Games
      • Upload to Itch.io
      • Host with GitHub Pages
      • Publishing to Steam
      • iOS and Android
  • Assets
    • 3D Models
      • Custom collision shapes
      • Material slots
    • Materials
    • Textures
    • Prefabs
  • Gameplay
    • Actors
      • Creating actor classes
      • Actor parameters
      • Actor components
      • Actor lifecycle
      • Spawning actors
      • Moving actors
    • Services
      • Load assets
    • Player input
    • Collision detection
    • Physics
      • Physics body types
      • Applying forces
      • Ray casting
    • Trigger volumes
    • Character movement
    • Pointer events
    • Animation
      • Animation system
      • Character Animation
      • Animation State Machine
    • Sound
      • Audio parameter
    • World
    • Navigation
  • Shaders
    • Introduction to shaders
    • Creating shaders
    • Shader parameters
    • Typescript shaders
      • Types
      • Math functions
      • Attributes
      • Varying
      • Uniforms
      • Textures
      • Arrays
      • Select
      • Lighting
    • Painted materials
    • Water shader tutorial
  • Level design
    • Landscape sculpting
    • Landscape painting
    • Grass
  • User Interfaces
    • Creating user interfaces
    • Using React
    • VR
  • Visual Effects
    • Introduction to VFX
    • VFX Assets
  • Integrations
    • Arcweave
Powered by GitBook
On this page
  • Creating a VFX Asset
  • Placing visual effect in a scene
  • Using VFX assets in code
  • Spawning a VFX actor from asset ID
  • Spawning a VFX actor using a Visual Effect parameter
  1. Visual Effects

VFX Assets

PreviousIntroduction to VFXNextArcweave

Last updated 7 months ago

Creating a VFX Asset

You can create a new visual effect by clicking "Add new" in the asset browser. You will be prompted to enter a name for the visual effect asset.

Placing visual effect in a scene

After creating a visual effect, you can place them in scenes and prefabs just like other 3D models. In the asset browser, filter on "Visual Effects". Then click and drag the visual effect into the scene to place it.

Using VFX assets in code

Spawning a VFX actor from asset ID

You can reference a VFX asset in your code using the asset ID. This will spawn a VFX actor in the world and return it to you so that you can control the vfx using methods like play, stop, or adjust timescale.

@Actor()
class Player {
    private vfx = inject(VfxService)

    async onInit() {
        const vfxActor = await this.vfx.createFromAssetId('your-asset-id')
        vfxActor.play()
    }
}

Spawning a VFX actor using a Visual Effect parameter

To enable configuring which visual effect to use in the Hology editor, you can define a parameter on the actor. This can enable you to alse reuse the same actor class but change the visual effect asset.

@Actor()
class Player {
    @Parameter()
    private vfxParam: VisualEffect 

    async onInit() {
        const vfxActor = await this.vfxParam.create()
        vfxActor.play()
    }
}