Skip to content

Commit

Permalink
V3
Browse files Browse the repository at this point in the history
Stability
  • Loading branch information
werasik2aa authored Mar 9, 2022
1 parent e920943 commit c72d9a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public override void OnUpdate()
if (Input.GetKeyDown(KeyCode.Escape)) if (Paused) Paused = false; else Paused = true;
if (Input.GetKeyDown(KeyCode.G)) if (Physics.Raycast(ray, out hit, 5f)) {
MelonLogger.Msg(hit.transform.gameObject.name);
foreach (GameObject i in hit.transform.parent)
GameObject[] par = hit.transform.gameObject.GetComponentsInChildren<GameObject>();
foreach (GameObject i in par)
{
MelonLogger.Msg(i.name);
}
Expand Down Expand Up @@ -218,11 +219,11 @@ public static void SpawnCar(int PlayerId, int SceneId, string name, Vector3 Posi
key1.tag = "CarVehicleMod";
key1.layer = LayerMask.NameToLayer("Player");

Transform[] i = key1.GetComponentsInChildren<Transform>();
GameObject[] par = key1.GetComponentsInChildren<GameObject>();

foreach (Transform b in i)
foreach (GameObject b in par)
{
b.gameObject.layer = LayerMask.NameToLayer("NPC");
b.layer = LayerMask.NameToLayer("NPC");
}

vehicles.Add(PlayerId, key1);
Expand Down

0 comments on commit c72d9a4

Please sign in to comment.