It's in FirstPersonControlPlayer in PlayerMovement.
It'll probably be easier to invert the CursorHorizontal / CursorVertical inputs in the Input Manager. Inverting the camera sensitivity may also do the trick.
i was going that route, but for the life of me, couldn't find the code to change the invert checkbox in the Input Manager at runtime. Happen to know it? XD
btw, i cant find a FirstPersonControlPlayer in my project. I have:
Edit: Nevermind, got it working by giving the Y sensitivity value in the FirstPersonCamera on the player a negative value.
@ChrisIceBox I'm currently swapping out the player itself to make this work - Choosing the inverted option in a menu swaps out the non-inverted player prefab with a duplicate player prefab that has a negative sensitivity value in its FirstPersonCamera component and vice versa.
If there's a way to change the sensitivity setting of the FirstPersonCamera by doing Object:Send Message, with a Custom message, please let me know! So far I haven't been able to determine what Method Name I would have to enter for this to work.
This script provides two functions to change the sensitivity to two separate values:
using UnityEngine;
using AC;
public class SetFirstPersonSensitivity : MonoBehaviour
{
public Vector2 sensitivityValuesOne, sensitivityValuesTwo;
public void SetSensitivityOne ()
{
KickStarter.player.FirstPersonCameraComponent.sensitivity = sensitivityValuesOne;
}
public void SetSensitivityTwo ()
{
KickStarter.player.FirstPersonCameraComponent.sensitivity = sensitivityValuesTwo;
}
}
You can place it in the scene or make it a prefab, and then trigger it with the Object: Send message Action with a custom message of the function names.
Comments
It'll probably be easier to invert the CursorHorizontal / CursorVertical inputs in the Input Manager. Inverting the camera sensitivity may also do the trick.
FirstPersonCamera
I was referring to the FirstPersonController function within the PlayerMovement.cs script.
Is this still the method to invert Y axis? Line 1414 seems to be different now.
Any ideas how to invert Y axis in AC instead of changing the Unity inputs? (Using Rewired so Unity input settings are ignored)
Edit: Nevermind, got it working by giving the Y sensitivity value in the FirstPersonCamera on the player a negative value.
@ChrisIceBox I'm currently swapping out the player itself to make this work - Choosing the inverted option in a menu swaps out the non-inverted player prefab with a duplicate player prefab that has a negative sensitivity value in its FirstPersonCamera component and vice versa.
If there's a way to change the sensitivity setting of the FirstPersonCamera by doing Object:Send Message, with a Custom message, please let me know! So far I haven't been able to determine what Method Name I would have to enter for this to work.
This script provides two functions to change the sensitivity to two separate values:
You can place it in the scene or make it a prefab, and then trigger it with the Object: Send message Action with a custom message of the function names.