Hello everyone, I’d like to request help with a small method.
I have 2 objects (A and B)that can be rotated via the arrow keys (on the X of A and Y axis of B). Also, when you press the key E, it will add to the objects X and Y rotations. When for 2 seconds in a row the E has not been pressed, I’d like to recover the rotation change made by the pressing of E. whatever rotation change was made via the arrow keys I’d like to ignore and take away from the end rotation whatever E added or subtracted from the rotation. So what I did was make a float for Net_X_Added and Net_Y_Added . Each time E was pressed, the amount it would add to the rotation the X or Y (ex: 6) was added to Net_X or Net_Y. I then made a new vector3 by subtracting NetX from the current Euler rotation X and did the same for Y.
So my question is, what’s a good way of doing this? My current implementation isn’t working right. I tested it by not even rotating via the arrow keys and just using E, So I’d expect it to go back to the original rotation, but It rotates to the wrong direction and end rotation.
I’d really appreciate some help with this, Thanks.