Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

VFX Graph Instantiate from Job, set Exposed Property Value

Discussion in 'Entity Component System' started by elJoel, Dec 20, 2020.

  1. elJoel

    elJoel

    Joined:
    Sep 7, 2016
    Posts:
    125
    Hi,

    So I have a Job that Instantiates some Entities that contain VFX Graphs. Is there any way to set the Properties on the VFX Component from within the job?

    upload_2020-12-20_17-47-12.png

    Something like this:

    Code (CSharp):
    1.                 if (dynamicSpawner.SpawnDust != Entity.Null)
    2.                 {
    3.                     var dustEntity = commandBuffer.Instantiate(dynamicSpawner.SpawnDust);
    4.                     commandBuffer.SetComponent(dustEntity, new Translation()
    5.                     {
    6.                         Value = translation.Value
    7.                     });
    8.                     /*commandBuffer.SetComponent(dustEntity, new VFXProperties()
    9.                     {
    10.                         PositionFrom = 100
    11.                     });*/
    12.                 }
    13.  
     
    TarikLarbaoui likes this.
  2. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547