Home Game Development Changing scale utilizing tween disables the contact occasion in Cocos creator 3.5.0? – Cocos Creator

Changing scale utilizing tween disables the contact occasion in Cocos creator 3.5.0? – Cocos Creator

0
Changing scale utilizing tween disables the contact occasion in Cocos creator 3.5.0? – Cocos Creator

[ad_1]

Hi all, I’m utilizing Cocos creator 3.5.0. I’m making an attempt to make flip animation for which I’m altering the size utilizing tween. When I exploit tween within the callback operate of contact occasion and attempt to change the size of a node, contact occasion is disabled after tween execution. For instance,

 begin() {

     this.node.on(Node.EventType.TOUCH_START, this.func, this);
 }

func() {

    tween(this.node)
    .to(2, {scale : new Vec3(this.node.scale.x + 1, 1, 0)})
    .begin();

}

According to this, node scale ought to enhance by 1 for each contact, however after the primary contact and tween is executed. The contact occasion is disabled (or could also be destroyed). I don’t know if it’s the difficulty within the editor or am I lacking one thing ?

A workaround would most likely be to scale an middleman little one of the node that deal with the contact occasion and never the occasion node itself.
And perhaps change the ui rework content material dimension of the contact node in order for you it to correspond to the scaled little one.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here