Hi, I'm trying to check distance from foundation to terrain, it's possible with RayCast, but I have issues with BoxCast, it does return false always. I need make a four casts from each angle.
Code:RaycastHit hitInfo; if (Physics.BoxCast(Block.bounds.center, Block.bounds.extents, Vector3.down, out hitInfo, Block.transform.rotation, float.PositiveInfinity, Rust.Layers.Terrain)) { SendReply(plan.ownerPlayer, "Distance to terrain " + System.Math.Round(hitInfo.distance, 4)); }![]()
BoxCast from Foundation
Discussion in 'Rust Development' started by azalea`, Apr 8, 2016.
