From 53cf5f5eee70919ba8c8e6d64ef6492439013bfa Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Wed, 13 Jul 2022 19:50:31 -0400 Subject: [PATCH] Add sphere collider to height map You can sometimes go straight through the mesh collider if you are fast enough. This sphere collider stops this from happening. Now you will bounce off the sphere collider. --- NewHorizons/Builder/Body/HeightMapBuilder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NewHorizons/Builder/Body/HeightMapBuilder.cs b/NewHorizons/Builder/Body/HeightMapBuilder.cs index 2c09240e..3d37ae2f 100644 --- a/NewHorizons/Builder/Body/HeightMapBuilder.cs +++ b/NewHorizons/Builder/Body/HeightMapBuilder.cs @@ -70,6 +70,9 @@ namespace NewHorizons.Builder.Body var cubeSphereMC = cubeSphere.AddComponent(); cubeSphereMC.sharedMesh = mesh; + var cubeSphereSC = cubeSphere.AddComponent(); + cubeSphereSC.radius = Math.Min(module.minHeight, module.maxHeight); + var superGroup = planetGO.GetComponent(); if (superGroup != null) cubeSphere.AddComponent()._superGroup = superGroup;