exporting position and rotation of player to a file

I would like to save x y z and rotation of player in a text file when certain events are triggered.
This is to match the sound experience (though max/msp) with the viz.
Is this possible in JS or C#?
or do I need to use .Net?
Any example?

No need to update xyz in real time, but it is ok to write these when a trigger is activated for now. So that a setting for the sound can be applied.
The sound stays and it is played wuthin Max MSP.

Ideally it would be in real time though, but this is next step, so first get something working, after refine it.

Suggestion will be very much appreciated
Thanks

G>

I would use Mono, and store the rotations and position in a string, then write/read to/from a text file via the TextReader and TextWrite.
http://www.go-mono.com/docs/index.aspx?link=M%3ASystem.IO.TextWriter.Synchronized(System.IO.TextWriter)

I have made a simple Udp communication between Unity and Max/Msp. You can find the Unity and Max script here http://forum.unity3d.com/viewtopic.php?t=5291

:smile:
will post more as soon as I get hands on
the idea is to output from unity positions and change the music accordingly.
So I need to reverse the nice script you posted earlier :slight_smile:
Let’s see if I manage…
thanks a bunch!
G.