Skip to content

Commit 9ca7f6f

Browse files
Script Execution Order Fix
1 parent 571b2de commit 9ca7f6f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Assets/Scripts/Core/ClothmeshGeneration.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using UnityEngine;
22
using System.Collections.Generic;
33

4-
[RequireComponent(typeof(PhysicsController))]
54
public class ClothmeshGeneration : MonoBehaviour
65
{
76
public int detail = 10; //10 means the mesh will be a 10x10 square grid (200 triangles)
87
public float meshSize = 0.1f;
98
public float meshDamping = 0.5f;
109

11-
private List<Spring> edges;
12-
private List<Pointmass> vertices;
10+
private List<Spring> edges = new List<Spring>();
11+
private List<Pointmass> vertices = new List<Pointmass>();
1312

1413
private PhysicsController physicsController;
1514

16-
void Start()
15+
void Awake()
1716
{
1817
physicsController = GetComponent<PhysicsController>();
1918

0 commit comments

Comments
 (0)