Control Particles Linear Velocity trough script

Hello,
First of all I’m an absolute beginner…

what I’m trying to do is to create a script where I can expose a public curve graph and use it to control the linear velocity of a particle system referenced in the same script

here is what I’ve done so far:

var ParticlesController = pc.createScript('particlesController');

ParticlesController.attributes.add("offsetCurve", {type: "curve", title: "Offset Curve", curves: [ 'x', 'y', 'z' ]});
ParticlesController.attributes.add("particleSystem1", {type: "entity"});

// initialize code called once per entity
ParticlesController.prototype.initialize = function() {  
    
};

// update code called every frame
ParticlesController.prototype.update = function(dt) {
    
    
    var curve = new pc.CurveSet(offsetCurve);
    
    
    this.particleSystem1.particlesystem.localVelocityGraph = curve;
    
};

I think I don’t know the correct syntax for “localVelocityGraph”.

thank you very much for your help

Giulio

Pretty close. localVelocityGraph is a pc.CurveSet (a curve for x, y and z) whereas you are trying to assign it a pc.Curve.

I’m sorry but i dont get it, my “var” is already a pc.CurveSet