Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

recursive input from file

Discussion in 'Scripting' started by Mokshya, May 29, 2015.

  1. Mokshya

    Mokshya

    Joined:
    May 29, 2015
    Posts:
    1
    I need to write data (data is just floating point number that shows the position) into a text file recurrently after every frame(18 frames/sec I guess) and also save it recurrently after every write---(using c++). Can I do it?

    For more details:
    I need to store position data which changes at every instant. This data is to mapped in UNITY as positions for an object. So, basically what happens is that when data in the text changes the position of object also changes.

    Please help!
     
    Last edited: May 29, 2015
  2. chubbspet

    chubbspet

    Joined:
    Feb 18, 2010
    Posts:
    1,220
    If possible, it would be better to write that data into an array and later write the whole array to the text file. You can use the System.IO class for that together with the StreamReader and StreamWriter objects. There are tons of tutorials on CodeProject etc.

    Edit: I just notice you mentioned c++. You will have to write a library for that or just do it in C#.