Search Unity

Saving object location in excel sheet

Discussion in 'VR' started by KenniKure, Aug 16, 2019.

  1. KenniKure

    KenniKure

    Joined:
    Aug 7, 2019
    Posts:
    39
    In a thread below (about placing markups and about falling through the terrain) I have resolved those two issues. (YAY!)

    I can now place a flag (markup point) using the Y button on the left controller. This places a markup 2 feet from the user. But the problem is, that i want to save the location of each object (markup/flag) that I place, and the coordinates of each flag needs to be stores in an excel file/CSV file.

    How can I do that? I was thinking about a for-each loop maybe? (e.g Input.GetKeyDown(KeyCode JoystickButton3) and every time I press that button it saves the object location i excel? Or is there a better/easier way to store the location data?
    upload_2019-8-16_12-52-17.png
    In the picture is the flag that I place (The flags dissapear thoug, when I exit VR mode??)

    upload_2019-8-16_12-53-32.png
    This is the code I have made to spawn the markups/flags.