Tuesday, November 22, 2022
HomeGame DevelopmentCreate an empty 2D challenge , after I add empty node ,set...

Create an empty 2D challenge , after I add empty node ,set its place – Cocos Creator


I created an empty 2D challenge. Within the challenge, I’ll create a node and name the setPosition perform to set the place of the node. When observing the node attributes, I discovered that within the perform I known as setPosition, I handed CC Ver2 vector, however calling the setPosition technique parameter passes Ver3 knowledge, leading to an extra z-axis knowledge, which is 0, however this causes the node to not be displayed.


You possibly can present your demo, i’ve examined and it really works properly.
57649.zip (4.9 KB)

set Place:

node.setPosition(x, x, 0);
node.setPosition(new Vec3(x, x, 0));

set place will work for each types.

examine node._layer worth.
set node._layer = 33554432

do this _layer will may match.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments