How to realize node.translate

I don’t understand why
this.node.translate(new Vec3(x, y, 0), NodeSpace.WORLD)
this.node.setWorldPosition(this.node.worldPosition.x+x,this.node.worldPosition.y+y,0)

got difference result, translate will be affected by scale.nodeSpace not work.

node.translate will move the object based on the node’s rotation angle, while node.setWorldPosition will not move the object based on the node’s rotation angle.

1 Like

What’s the difference in nodeSpace ?

You can read the documentation about the differences between coordinate systems:
https://docs.cocos.com/creator/manual/en/concepts/scene/coord.html#world-coordinate

I readed.but I dont understand why worldSpace will be effect with node scale