void OnCollisionStay(Collision other) { currentNode = other.gameObject.GetComponent <ConnectingNodes>(); // Replacing the node transforms upon colliding with the new current node, used for player movement nodes [0] = currentNode.connectingPlayerNode [0].transform; nodes [1] = currentNode.connectingPlayerNode [1].transform; nodes [2] = currentNode.connectingPlayerNode [2].transform; nodes [3] = currentNode.connectingPlayerNode [3].transform; currentNode = other.gameObject.GetComponent <ConnectingNodes>(); // Replacing the node objects upon colliding with the new current node, used for raycasting nodeObjects [0] = currentNode.connectingPlayerNode [0]; nodeObjects [1] = currentNode.connectingPlayerNode [1]; nodeObjects [2] = currentNode.connectingPlayerNode [2]; nodeObjects [3] = currentNode.connectingPlayerNode [3]; trailMemory [0] = currentNode.transform; // The new current node becomes the first trail memory. }
void OnCollisionEnter(Collision other) { currentEnemyNode = other.gameObject.GetComponent <ConnectingNodes>(); // Replacing the nodes upon colliding with the new current node nodesEnemy [0] = currentEnemyNode.connectingEnemyNode [0].transform; nodesEnemyObjects [0] = currentEnemyNode.connectingEnemyNode [0]; }