I am looking to import an excel file (in csv format) that contains the coordinates (x,y,z) for 3 different actors (named A,B,C) over a 2 second period. So essentially I have a location for each actor at second 0 (starting position), 1 and 2 (final position). The actors could be something as simple as a cube for argument sake.
I was thinking i could use the “Move Component To” function to move the actors between each x,y,z location for each second, but I am having trouble setting up the blueprints. Any help would be much appreciated. I am guessing it involves both arrays to store the different Actor names, and a Structure set up to store the different x,y,z locations associated with each Actor name.
I feel like this can be dramatically simplified from what is shown, at least as far as the functionality in the description is concerned. All that’s needed is a struct with a single variable:
Everynone, I was genuinely wondering if it was possible to somehow tag you in my quesion - turns out the bat signal was not needed
Thanks for taking the time to write up that explanation. Unfortunately, I can’t easily rewrite the CSV rows into your format (though it makes a lot more sense) because I have 3000 rows of cordinates and about 50 Actors (see snippet below). So I was thinking I need unreal to do the “tidying up” of the csv input.
If you try to do Array, you would need to set all the coordinates for each A B C (Each have a Separate Array) then each second would choose Each Index from said Arrays (1 second set A B C index of Arrays to 1) (Unreal Starts at 0)
Your proof of concept looks spot on in terms of what I am hoping to achieve! No rush, appreciate any help at all! yes all Actor names are ordered numberals (all integers).
The actors could be something as simple as a cube for argument sake.
If we knew how the actors should be referenced, it’d be quite possible to incorporate the references directly into mSecondsMap, rather than fetch them via whatever other methods is necessary. Here it’s a hard-coded map:
Wow, very impressive stuff! I learned a lot here, so thank you very much. I am planning on having all the actors as static meshes - to incorporate the references directly in mSecondsMap, would that involve adding a static mesh (array) like this?
I am curious what is in your Move to function? I assumed the way to move static meshes smoothly from location to location was by using a Move Component To tick, but that can’t be used inside a function. Does your Move to function just contain a Set World Location node for the actors your feeding into it?
Since the static mesh is at the root of the actor, the Relative Location becomes World Location. But the movement can be done in many ways, depending on what the end goal is.
would that involve adding a static mesh (array) like this?
You said boxes are actors, so ideally that’d be actors. But yes, that’s the idea. They could even be spawned dynamically based on the data. This can be done with just components, surely.
Finally got my head around your approach and I am 95% of the way there my end. Last hurdle to leap is getting the Move Component To to work inside the For Each Loop. They don’t seem to play nice together so I am guessing that is why you have it in a Custom Event called MoveTo? When I just use a Set World Location in place of the Move Component To, the whole thing works fine but obviously the Cubes jump from location to location instead of gradually moving, which is what I want. Do you know where I am going wrong here? Your code is shown above, mine below for reference.
One cannot combine loops with latent nodes - note the clock icon on the MoveComponenTo.
My MoveTo is a custom event that lives inside another target actor (since each box was supposed be an actor, as in the original description I tried to adapt to - not guilty ;p ); meaning each actor has an instance of `MoveComponentTo’ which, once fired, can live its own independent life detached from what the loop is doing.
You’ll end up with a static mesh component that can handle a mesh asset, but can also host script and variables. I can’t stress enough how convenient this can be at times, and how well it keeps things low profile.
Option 2:
Instead of trying to Move while the loop is looping, let the loop finish and add everything to a neat map as you do. When the loop has completed, fire a Timeline or Move Component To. But then you’ll need to handle data differently. Here’s an example:
Ignore the track being a vector, you’d use a 0-1 float as alpha. Another example:
Top bit prepares the data first, then a timeline moves multiple elements of an array.
There’s probably Option 3 & 4 out there that eludes me. Do tell how it goes. I’ll be around later this week.