How to block the camera to go beyond +90 degree or -90 degree but calculating based on where the body is facing?
I’m using the Game Animation Sample project and turned it into a ‘True First Person’ but it had a problem with my camera being snapped to the middle if I look at +90 degree or - 90 degree so I fixed it by changing some values (Idle and Moving values in the select node (I changed it to 360 for both)):
So now it don’t snap back to the middle but now when I look beyond +90 degree or -90 degree it just snaps back to the other side of the 90 degree, for example: If I’m facing a wall where there is a poster, if I look beyond 90 degree of my left it snaps me back to the 90 degree of right, and it’s not because of the camera it is because of the neck animation in that project.
So I tried to limit the view by adding this blueprint:
Game Animation Sample use root offset that mean the capsule rotation is different than the mesh rotation, so the solution is redo that part, the important points are.. The camera is child of the capsule or the mesh? the camera rotate the capsule or the mesh?
For it to work well in FPS, you need the camera to rotate the capsule and when it reaches a certain angle you need to tell the OffsetRootBone node to rotate the mesh, and the camera works better if is attached to the mesh
Well, that makes it easier to implement, you just have to see what property the right mouse button replaces and handle the logic differently. But I still think it could cause problems at the turn in place.
Holding down RMB while turning fast more than 90 degree still causes some glitch so I was hoping to just restrict the camera to turn (±)90 degree and not more than that, then if I gotta look somewhere else beyond (±)90 degree then use RMB to turn the whole mesh.