removed terrain col on end episode & vfx graph adj

This commit is contained in:
2024-03-28 17:34:32 +00:00
parent c58d9a1e80
commit 0c43e5ccd4
4 changed files with 187 additions and 12 deletions

View File

@@ -63,6 +63,10 @@ public class RagDollAgent : Agent
private float x = 0;
private float y = 100;
public TerrainCollider m_TerrainCollider;
public LayerMask m_ExcludeLayer;
public LayerMask m_Temp;
void Awake()
{
if (RequestCamera && CameraTarget != null)
@@ -224,6 +228,13 @@ public class RagDollAgent : Agent
if (!waitStarted)
{
waitStarted = true;
//Disable Ground Collider
if (m_TerrainCollider)
{
// Exclude Marathon from Collider
m_Temp = m_TerrainCollider.excludeLayers;
m_TerrainCollider.excludeLayers = m_ExcludeLayer;
}
}
timer += Time.fixedDeltaTime;
@@ -232,6 +243,7 @@ public class RagDollAgent : Agent
{
timer = 0;
waitStarted = false;
m_TerrainCollider.excludeLayers = m_Temp;
EndEpisode();
}
}