Download

Locating actor coordinates and outputting them as text?

Hello!
I’m new to UE4, I’m trying to make a car racing game to use as a testing tool in an experiment.
I used the advanced vehicle blue print & followed one of the tutorials on how to track time on the UE4 youtube channel.

I now wanted to get the game to track/record where the car is at any given time while its racing and output its coordinates on a text file.
I can print the time on the screen, but I have no idea how to print something outside of the game itself. Is it possible?

Also what function do I use to get the vehicle’s coordinate position?

To get vehicle cordinates:
in vehicle blueprint find part of vehicle you want to trace (best would be chassis mesh), drag it to car blueprint you will get blue node that is reference to that part of car. Then out of it you can get component world location or component world transform.

As to printing, maybe debug tools let you write log to file, i am not sure about that. But you have C++, and it should be very basic thing to write to some predetermined text file. Google for “C++ write text to file” and then watch some C++ basic tutorial for unreal engine, (best would be how to create custom bp node in C++). That stuff is really very easy and well documented. Making that C++ code with installing visual studio and watching tuts should be one evening. And eventually at some point you want C++ anyway, so why not to start now?

Thank you for the quick response!
I will be trying that out!