Expanding sphere help

is it possible to code a sphere to expand via deltaTime?

im trying to have an expanding sphere as a “radius scan” effect. but i cant seem to find a way to increase its scale overtime

var ExpandSphere = pc.createScript('expandSphere');

ExpandSphere.attributes.add("speed", {
    type: 'number',
    default: 1
});

// update code called every frame
ExpandSphere.prototype.update = function(dt) {
    var currScale = this.entity.getLocalScale();
    var newScale = new pc.Vec3(currScale.x + dt * this.speed, currScale.y + dt * this.speed,currScale.z + dt * this.speed);
    this.entity.setLocalScale(newScale);
};
3 Likes

oh my gosh thats exactly what i was looking for! thank you so much!