Hello,
I'm a neuroscience student and I need to save the continous x, y and z data from player direction and rotation, as well as key presses, positions of rocks in a river, and other triggers.
Is this possible with easysave ?
How would you use it to do so (especially for the continuous x,y,z positions)
Best,
Thomas
Save continuous x, y and z positions player in csv or txt file
-
- Posts: 2
- Joined: Tue Jun 02, 2020 9:32 pm
Re: Save continuous x, y and z positions player in csv or txt file
Hi Thomas,
This is indeed possible. In fact the easiest way to save continuous position to a CSV would be to do the following:
You could also add additional columns to the spreadsheet if necessary representing your other data.
All the best,
Joel
This is indeed possible. In fact the easiest way to save continuous position to a CSV would be to do the following:
Code: Select all
using UnityEngine;
using System.Collections;
public class SaveContinuous : MonoBehaviour
{
void FixedUpdate()
{
// Create a blank ES3Spreadsheet.
var sheet = new ES3Spreadsheet();
// Save some values into the spreadsheet.
sheet.SetCell(0,0, transform.localPosition.x);
sheet.SetCell(1,0, transform.localPosition.y);
sheet.SetCell(2,0, transform.localPosition.z);
// Append the row to the existing spreadsheet, or create a new one if it doesn't exist.
sheet.Save("myData.csv", true);
}
}
All the best,
Joel
-
- Posts: 2
- Joined: Tue Jun 02, 2020 9:32 pm
Re: Save continuous x, y and z positions player in csv or txt file
Hi Joel,
Thank you so much this is super helpful !!!
Best,
Thomas
Thank you so much this is super helpful !!!
Best,
Thomas