Hello, and thanks for the help!
I am trying to make a minecraft-esque like building system, where you click on blocks and new ones are made. I have a raycast system that calls the following function,
EntityCreator.prototype.spawnCube = function(){
//Initial Parent Block Init
eval("var block" + i + " = new pc.Entity();");
eval("block" + i + ".name = 'block" + i + "';");
var afterBlockPosX = blockPosX + 7;
var afterBlockPosY = blockPosY - 4.5;
var afterBlockPosZ = blockPosZ;
eval("block" + i + ".setLocalPosition(afterBlockPosX, afterBlockPosY, afterBlockPosZ);");
eval("this.app.root.addChild(block" + i + ");");
//under here the sides of the block with the actual collisions and visuals are added
where blockPosX, Y, and Z are the position of the entity that the raycast hit (which would be one of the sides of the block). I tried this out and ran across a weird offset so I added the afterBlockPos variables to fix it. However, then I tried to click on the blocks that where created and the offset effect seems to become exponentially more of a problem. This also applies without the offset I added, the offset that was already there getting worse instead.
I have been trying to fix the offset and am stumped. Any help would be greatly appreciated. Below is the project link if needed.
https://playcanvas.com/editor/project/1091602
Thanks again, Nathan