Can't change position of entity


I have mesh on scene - this is a plane, and i need to put Spheres at each point of this plane.
I do following:

initialize: function () {
        var i = 0, meshInstance = null;
        for( ; meshInstance = this.entity.model.model.meshInstances[i++]; ) {
            if (0 ==='Plane_')) {
                this.plane = meshInstance;

        if (null === this.plane) { // i pass this always with no error
            console.error('Could found Plane mesh of model:' +;

        if (this.plane.mesh.vertexBuffer.numVertices < 4) { // i pass this always with no error
            console.error('Plane mesh has unexpected count of vertices. There gotta be at least 4 vertices.');

        var vertexBuffer = this.plane.mesh.vertexBuffer;

        var vertices = new Float32Array(;
        var size = vertexBuffer.format.size / 4; // bytes -> float32

        for(var vertexIndex = 0; vertexIndex < 4; vertexIndex++) {
            var point = new pc.fw.Entity();
            var pos = new pc.Vec3(
                vertices[vertexIndex * size], 
                vertices[vertexIndex * size + 1], 
                vertices[vertexIndex * size + 2]);
        point.setName('point_' + vertexIndex);
  , { type: 'sphere' });

            point.setScale(0.5, 0.5, 0.5);
        // .... 

The problem is that method setScale, setLocalScale, setPosition, setLocalPosition, translate does not make any effect on point - why?

point and Sphere attached to the point always stay at ceneter of scene. what I do wrong.

There is no function setScale on an entity. You should use setLocalScale().

Apart from that it looks reasonable. Do you have a project link I could take a look at?

Aside, it’s just worth pointing out:, {type: 'sphere'});

Can now be replaced with:

point.addComponent("model", {type: 'sphere'});

Also, the context var which used to be passed into the script create method is now an instance of the pc.Application and is generally called app in all new scripts.

setScale was a reason of problem. Looks like i missed error messages about setScale becouse of tons other debug information. Now it works fine.