audioSource设置音量volume无效

如题,我想要根据玩家和音源的距离来动态设置音量
可是设置不起作用。

代码:
`
properties: {
audio: cc.AudioSource
},

onLoad: function () {
    let manager = cc.director.getCollisionManager();
    manager.enabled = true;
    //console.log(this.audio);
},

onCollisionStay: function(other,self){
    if(other.node.group == 'player'){
        let vector = this.node.convertToNodeSpaceAR(other.node.parent.convertToWorldSpaceAR(other.node.position));
        let otherDistance = vector.mag();
        let selfDistance = self.radius;
        let rate = cc.clamp01(otherDistance / selfDistance);
        let revertRate = 1 - rate;
        this.audio.volume = revertRate / 2;
    }
}, 

onCollisionExit: function(other,self){
    if(other.node.group == 'player'){
        this.audio.volume = 0;
    }
},

`

解决了,如果一开始的音量是0
那么哪怕勾上playOnLoad
在代码里面读到的isPlaying也是false 得手动再play

额,我是用cocos creator的,那个volume不能调节啊,只能是1.晕倒!!

已经解决了,原来能设置的数值范围是0-1