Helo, i just want to concert my position but i have that : Normally, the template block have to bet just next to to parent. Code (CSharp): if (Physics.Raycast(ray, out hit, maxSetDistance)) { Vector3 point = ray.GetPoint(hit.distance - 0.02f); templateBlock.SetActive(true); Vector3 _position = new Vector3( Mathf.Round(point.x / _blocKPosRound) * _blocKPosRound, Mathf.Round(point.y / _blocKPosRound) * _blocKPosRound, Mathf.Round(point.z / _blocKPosRound) * _blocKPosRound); if(hit.transform.parent != null) templateBlock.transform.parent = hit.transform.parent; else templateBlock.transform.parent = hit.transform; Vector3 _LocalPosition = templateBlock.transform.parent.InverseTransformDirection(_position); templateBlock.transform.localPosition = _LocalPosition;
In hierarcy templateblock goes as a "templateblock parent" child? Code (CSharp): if(hit.transform.parent != null) templateBlock.transform.parent = hit.transform.parent; else templateBlock.transform.parent = hit.transform; this if i dont really get it. Code (CSharp): //Maybe you should delete the if and say templateBlock.transform.parent = hit.transform;
I don't know if your modification will change something but I will Try that tomorrow. If somebody have another solution..