Get Control Rotation and save to array

Hi,
i have a problem with my Blueprint function to save the control rotation in an array.

In this picture you can see the function. I add the Control Rotation to an array, after that i have a delay before i add the next control rotation (in this case 0.01 sec).
And after a second delay (in this case 10sec) i stop recording the control rotation.

To show you my problem i give you the content of my array, after 10 seconds of recording:

109957-values.jpg

as you can see, there is something that can not handle those short delays, or somerthing that has limitations.
What strikes is that 0.01 and 0.02 sec delay produce the same amount of values…
i did other test, with a 3 minute (180sec) record and 0.01, 0.15, 0.02 sec of delay all producded an array
with about 4000 entries.

So is there someone who can tell me why this happens? Or maybe is there an other implementation that could handle those short delays?

Maybe someone can help me :slight_smile: thanks

Are you doing this inside the Tick event line of execution? If you are not then you should, I mean, there would be no point in getting the rotation at a higher rate than the game fps since the values would just be duplicated, right? I wouldn’t use a sequence and delay node for a function like this.

I would do something like this:

Hey MacDX, thank for your answer :slight_smile:
i tested your method and got nearly the same results.

i am working with a Oculus Rift DK2 so i have max 75FPS.
I am working on predicting head positions, therefore i have to test
different extrapolations methods. Therefore i need the positions
every 10ms, 15ms, 20ms.

The things is, for prediction of the head movement, the measurements must be lower then die
FPS.

In this process, it is not a problem, as you said, that there will be sometimes the same values, which are measured and saved to the array.

For example, my function runs 10 seconds and every 0.2sec i want to read out and save the control rotation…
the result is, that there are only 44 instead of 50 entries in my array.

i mean, it does not matter if some values are the same because there is now updated position yet, the question is, why arent there 50 entries…

another observation:

im runnig my normal game at 120FPS for 10 seconds:

Record rate 0.009 → ~600 entries
Record rate 0.007 → ~1200 entries

more accurate:
Record rate 0.0084 → ~600 entries
Record rate 0.0083 → ~1200 entries

I do not know what this result tells me :confused: :smiley:

Can you show me how you tested my method? I can’t understand why an array would behave like that.

Ok maybe what you need is to get out of the tick and get this data that you need on a separate thread.

If you are comfortable with C++ you could try this:
link How to Create Threads in UE4
or this:
Multi-Threading: Task Graph System

I seriously have no idea why that process is behaving like that. I’ll try to do some tests to see if I can replicate your problem

but this what i expected and makes sense…

Event Tick: This is a simple event that is called on every frame of gameplay.

So my maximum rate for recording the rotation is 1/FPS

So the question is if there is a way to call functions and method independent from the framerate