implementation of drecon in unity 2022 lts forked from: https://github.com/joanllobera/marathon-envs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
635 B

using UnityEngine;
namespace Unity.MLAgents
{
public class HandleOverlap : MonoBehaviour
{
public GameObject Parent;
void OnEnable()
{
enabled = false;
if (Parent == null)
return;
var collider = GetComponent<Collider>();
var parentCollider = Parent.GetComponent<Collider>();
if (collider == null || parentCollider == null)
return;
// Debug.Log($"Physics.IgnoreCollision: {collider.name} and {parentCollider.name}");
Physics.IgnoreCollision(collider, parentCollider);
}
}
}