I’m hoping that some of you can enlighten me out with an issue I’ve been having with. Below is the blueprint example for adding delay to x-axis mouse input.
The blueprint for x-axis input work perfectly only when I use integer number (10) for the default value of “New Var 1”. There is noticeable delay when we compared the mouse reaction for x-axis and y-axis.
The problem arise when I use float number (0.1) for the default value (mouse control for x-axis is not responding)
Any help and advice would be much appreciated.
That is because you when you go from float to int you drop the trailing digits.
3.1415… becomes 3.
As such, when you get the value for the axis input you get a value between 0 and 1. So when you remove the trailing values you get 0.4356 → 0. When you multiply by 10 you get 4.356 → 4 instead. Naturally, when you multiply by 0.1 then the highest value you can get is 0.1 which is never going to be anything other than 0.
Why are you doing it this way though? Why an array? And why the multiplication? If you simply want a delay, then you can just cause an acceleration instead?
The reason you get a lag effect when you use your current setup is because you have to go through 10 steps before you get to the input. That means that you get 10 frames before your input reaches the final node.
Final problem, if you set the variable_1 to 0.1, thus 0, you will try to access array location -1 and that can not be correct.
Thanks for the explanation. I forgot to add comment for the nodes before and here it is. The mouse input’s frames insert at index 0, and remove the frame above the delay to avoid the array being longer than necessary. After that I get the frame that corresponds to the required delay. By doing this the delay would be continuous just as I wanted.
There are any workaround that I can use to solve this problem?
No, you can not use anything smaller than 1 or you will have this problem. Maybe if you could explain why you would want to have a value < 1 I can understand the motive better and thus give you a better answer, but for now; no, you cant.
I am experimenting the effect of delay in VR headset. If I lock the frame per second at 60 and and set the Default Value for the Frame Delay X to 1, I can only simulate down to 16.7 miliseconds (excluding the monitor/headset and system delay). I need more precision in order to continue my project.
Tried using a simple delay node?
I’ve tried implementing the the delay node directly to the output and the outcome is not what I expected. Rather than continuous effect of delay, I only get stuttered movement for my mouse. Could you elabore what simple delay node mean? I’m still new on blueprint and my knowledge are pretty limited.
Then the only option you have left is to create a elastic band effect where you hide the mouse pointer and instead draw a pointer on the screen using some calculated coordinates. Every tick, update the actual mouse position and then interpolate between the current position and the actualMouse position. That way you can change a variable and get any kind of delay.
This is the only way I can see this working out.
If you want me to I can create a screenshot example if you do not understand what I mean. Just let me get back home so you have to wait a bit.
Take a look at this, I am assuming you can read it. If you cant, tell me.
Ahhh I see. I will try the solution from the link you show me. Maybe tomorrow I will report back the outcome at here. Thanks.
I’m sorry but I do need the screenshot example for the solution you mentioned before. The solution from the link show that by using interpolation we can add the number at high speed that gradually slow down till it reach the max value. But I just can’t see the connection on how to apply it to my blueprint.
Something like this.
You can change the Elasticity variable to increase or decrease the effect.
This is not a delay per se as it will not remember all your input, but it will act as if you have a spring attached so it moves slightly slower. If this is not usable you can maybe store the input as you are doing and mix it with mys solution.
Interpolate until you hit the saved point P0, then remove it and interpolate to the new point.