mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
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.
This commit is contained in:
parent
19e9bbf52a
commit
53cf5f5eee
@ -70,6 +70,9 @@ namespace NewHorizons.Builder.Body
|
|||||||
var cubeSphereMC = cubeSphere.AddComponent<MeshCollider>();
|
var cubeSphereMC = cubeSphere.AddComponent<MeshCollider>();
|
||||||
cubeSphereMC.sharedMesh = mesh;
|
cubeSphereMC.sharedMesh = mesh;
|
||||||
|
|
||||||
|
var cubeSphereSC = cubeSphere.AddComponent<SphereCollider>();
|
||||||
|
cubeSphereSC.radius = Math.Min(module.minHeight, module.maxHeight);
|
||||||
|
|
||||||
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
|
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
|
||||||
if (superGroup != null) cubeSphere.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
|
if (superGroup != null) cubeSphere.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user