My character has two movement modes for unequipped and equipped states.
Unequipped - mouse movement does not affect the rotation of the camera (Default)
Equiped - player SHOULD turn with mouse movement (or controller right analog stick)
I am trying to do all this in C++.
Initially when I achieved this in Blueprints only. I had an AxisTurn variable which was getting a float value from the mouse this way.
This was done following a BlueprintGames youtube tutorial.
So as it is, I am just trying to translate all this to just using C++ and I think its safe to assume I just need to get the Mouse Axis value when I equip a weapon
Which then should affect the value in my animation blueprint. Unless I am thinking about this the wrong way? Basically the question is, whats the best way to toggle Controller Rotation Yaw on Equip/UnEquip weapons in this case?
Ah I see. I take it at this point its more than just getting the axis value. Would part of the solution be setting the Rotation from the Character Movement? i.e
bOrientRotationToMovement = true;
bUseControllerRotationYaw = true;
Ignoring how everything is set up so far in the first screenshots
When player has no weapon equipped, this is how they are controlled by default
(Mouse movement does not affect rotation of the player)
Once they equip a weapon, then Character rotates with mouse movement (i.e Camera stays behind players back)
Screenshots shown in initial post was how it was achieved in blueprints only, but I am trying to get this done in c++ instead. To toggle between the two modes based on equiped and unequipped weapon.
How would one go about switching between the two types of movements?
I was guessing it was something to do with
UseControllerRoationYaw and OrientRotationToMovement?
or there’s a different way?
I haven’t looked too much into it but what you outlined in your OP made sense to me. You had it working in BP, I thought the only issue left was the last screenshot which can be done via the input binding mentioned.
Its seems in addition to that I have to set the state of these two Boolean variables as well.
These would be from the Character Movement component I believe.