Hello all,
In my game I am spawning a large number of tiles that will be individually scaled in the y direction. I have been trying to change the halfextent of the collision component to match the entity, but for some reason changing the halfextent in the code does not seem to be reflected at run time.
Here is the relevant code:
var tile = new pc.Entity();
tile.addComponent(“model”, {type: ‘asset’, asset: this.model});
this.app.root.addChild(tile);
tile.addComponent(“collision”, {type: ‘mesh’, asset: this.model});
tile.setLocalScale(1, stretch, 1);
tile.collision.halfExtents = new pc.Vec3(0.5, stretch / 2, 0.5);