I made sure terran collider is added to both the terran and the character as the last component, with is trigger off. However, when I add the third person controller to the character, it falls right through the floor. when I don’t add it, the character is on the floor but now unable to be controlled.
CAN I ASK HERE ?
I know this is a hard one so a big thanks in advance. So I have this game called borda and the world is made of many many cubes. I can’t figure out how to save it all with out the game crashing. So if you guys can help me have unity save and load all this stuff I would be very thankfull. This is how it looks /HERE IS SAVING WRITTEN CAN I ASK YOU TO WRITE LOADING FOR IT TO BRING IT PERFECTLY BACK TO SCENE?
using UnityEngine;
using System.Collections;
using System.IO;
public class SaveGame : MonoBehavior
{
public GameObject cubes;
protected string savename = “savegame”;
private void Start()
{
cubes = FindGameObjectsWithTag("Floor");
}
public IEnumerator Save()
{
foreach(GameObject cube in cubes)
{
Vector3 pos = cube.transform.position;
Quaternion rot = cube.transform.rotation;
AddCube(pos, rot);
yield return new WaitForSeconds(0.01f);
}
}
public void AddCube(Vector3 pos, Quaternion rot)
{
float[] xyz = new float[3], hpb = new float[3];
// Pos Rot
xyz[0] = pos.z; xyz[1] = pos.y; xyz[2] = pos.z;
pos[0] = rot.z; pos[1] = rot.y; pos[2] = rot.z;
if(File.Exists("saves/" + savename + ".txt"))
{
using(StreamReader saveFile = File.OpenText("saves/" + savename + ".txt"))
{
foreach(float item in xyz)
{
saveFile.Write(item.ToString("R"));
}
saveFile.Write("-"); // Separator
foreach(float item in hpb)
{
saveFile.Write(item.ToString("R"));
}
saveFile.Write("
“); // Line break
}
}else{
using(StreamWriter saveFile = File.CreateText(“saves/” + savename + “.txt”))
{
foreach(float item in xyz)
{
saveFile.Write(item.ToString(“R”));
}
saveFile.Write(”-“); // Separator
foreach(float item in hpb)
{
saveFile.Write(item.ToString(“R”));
}
saveFile.Write(”
"); // Line break
}
}
}
}
AND HAVE 100 VERSIONS OF LOADING IF SOME TRIES TO KEEP IT UANSWEWRED