Hi there! I was wondering how should I procede in a game where I want to continuously rotate the pitch and yaw based on my mouse location. So basically i want to have a non conflict zone where if the cursor is in middle where nothing should happen.
The first image shows you what the following BP will do. It takes a circle around the mouse cursor and maps every mouse location to it. Closer to the center, Output will be X=0, Y=0.
Mouse Right side of circle X=1, Y=0 | Mouse left side X=-1, Y=0.
Get close to the top of the circle, Output will be X=0, Y=-1; | bottom X=0, Y=1
Every value in between is normalized
Here in Tick, we calculate a vector from the center of the screen to the mouse location. Check the length of it and divide the length by the radius of the circle to get it mapped to values between 0 and 1.
All you have to to do is use the X and Y output and use it as you would with normal mouse or controller input.
Hope this help, I am here for any problems you might encounter.
Just plug the output into MakeRotator X and Y directly every tick. No need for InputAxis stuff. X and Y of the normalized output are a replacement for InputAxis LookUp and LookRight.
DennyR I just hit a problem with the mouse cursor you helped me implemented. When I enter launch the script stop working. I guess I have to do something but i don’t know really what. Can you give me a hand?