I am in a project in which I must record the player’s movements while playing. I was thinking that maybe I could make the player draw a spline that could then be exported to other software for study. He also thought about recording the player’s coordinates every certain time interval, and then visualize the information in excel (or similar).
I still do not decide which of the two forms, but it seems to me that the first one is a little more practical than the second.
Either way, recording position at an interval is the way to go. Then you can use that information to create a spline point at each recorded location and render a particle line along the spline you created.
You’re right. it’s been a while since I’ve been working with blueprints on Unreal, is there a simple way to do that? or any video tutorial that explains it?
Not sure at this point if you want to draw the spline or not - you mentioned exporting raw data. But here’s a 5 min. craft that may help; not a looker:
Let me to elaborate, I do see my mesh being gemerated and following the character, but its chaotic, not centered at the character at all. Its also camera sensitive for some reason. And it seems to become more accurate the closer I am to the center of map.
Thats cool, but I couldnt get it to work. Could you elaborate on how you setted this up? Also where did you get the splineeditormesh and material?
Cheers m8
It’s probably still in the Relative transform mode while you will want Absolute Location & Rotation for this:
This may have more to do with the size of the world; float precision could be a culprit here and is a normal behaviour. You’d need to include more details here - what the worlds is made out of and what distances we’re dealing with. But this is probably unrelated to the spline itself, though.
It’s part of the engine:
But you should be using your own mesh and your own material for this. This one is not suitable. The little demonstration above nothing more than a proof of concept and should not be used as is.
Here’s a another, slightly different approach - this one takes into account the player standing still and creates points only if you’ve moved far enough from the previous location.
This starts on Begin Play. You could play with tangents manually but it may not be necessary, depends on the desired end results:
This is just the spline, now you need to hook it up to a spline mesh component. Do a quick YT search - this is something covered extensively. One way or another, this will need a lot more work to get a usable state, for sure.
@Everynone When you get a minute, would you mind quickly stepping through your BP code? For the most part it is quite clear. I can’t understand, however, why you have two parallel processes that seem to be doing the same thing. The solution that you have provided is something that I am looking for to help visualize paths during testing.
There are no 2 parallel processes and no duplication. Once the Begin Play starts the timer at the top, the timer keeps executing the event.
Perhaps this bit was unclear:
The Begin Play also adds the very first point to the path - at the player’s location. This is necessary since the timer will refuse to drop a point unless the player has moved away far enough from the previous location.
Without the first point, we’d have nothing to measure the distance against, timer can’t drop the point because the player hasn’t moved. So we force drop the first point when the game starts.
@Everynone I’m sorry, I didn’t mean to imply that it was. It just looks that way to me because I’m getting lost in the logic. In other words, I don’t see the forest, just the trees
DUDE! You are a champ! I’ve been looking all over the internet on how to do this. I’m always telling myself “I’m sure someone has done it already” and here I found you! Thank you so much!
question: is it possible to stop generating the spline mesh and continue generating it somewhere else in the level but not connected to the previous spline mesh created?
cool appreciate it man thanks a lot! I’d like to add a question.
how do I seperate the spline generator from the thirdperson character blueprint. Basically I want it to be outside of the ThirdPersonBp but it’s still generating the spline mesh using the ThirdPersonBP’s location?