hello,
I just added some entities as children of an entity and it seems that transformations on parent are not applied to the newly created childrens.
In the exemple here, I’m creating x cylinders around a wheel
for (var i = 0; i < this.nbPies; ++i) {
//computing location
var angle = (i * this.increments) + (this.increments / 2.0);
var v = new pc.Vec3(Math.cos(angle)*this.radius, Math.sin(angle)*this.radius, 0);
//creating entity
var entity = new pc.Entity();
entity.setPosition(v);
// Debugging visuals
// add a new Model Component and add it to the Entity.
entity.setLocalScale(0.1, 0.1, 0.1);
entity.rotateLocal(90, 0, 0);
entity.addComponent("model", {
type: 'cylinder',
});
this.entity.root.addChild(entity);
}
Then if call :
this.entity.rotateLocal(0, 0, this.rotationSpeed);
The created entities whill not rotate around the center.
Same thing if I disable the wheel.
app.root.findByName(‘Game’).findByName(‘Wheel’).enabled = false;
created children are still visible.
Thank you for your help