Saturday, June 25, 2022
HomeGame DevelopmentCocos creator contact begin occasion doesn't work if you apply scalling run...

Cocos creator contact begin occasion doesn’t work if you apply scalling run time – Cocos Creator


Beneath code is not going to fireplace contact occasion

node.scale= new Vec3(0, 0); 
node.on(Node.EventType.TOUCH_START,operate(e){
    //this occasion doesn't work as scale apply runtime
});

Following code will fireplace contact occasion as scale not apply runtime

node.on(Node.EventType.TOUCH_START,operate(e){
    //this occasion will work as scale doesn't apply runtime
});

Let me know there’s particular motive behind this. I’m utilizing editor 3.5.1

Observe: I’m utilizing chrome browser to simulate the sport.


After a lot of work, I discover that I have to go all three arguments in Scale = Vec3(x,y,z).

node.scale= new Vec3(0, 0, 0); 
node.on(Node.EventType.TOUCH_START,operate(e){
    //this occasion works as scale apply runtime too
}); 

tween(node)
.to(1,{scale:new Vec3(0.5,0.5,0.5)})
.to(1,{scale:new Vec3(1,1,1)})
.begin();

Simply sharing if somebody discover similar problem.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments