Angelbeats
Member
I need to use a Slider to control the mouse sensitivity. I tried to use the "UnityInput.LookSensitivity.Set(sliderValue, sliderValue)" method but it didn't work.
What method should I use?
What method should I use?
UnityInput.LookSensitivity.sqrMagnitude, UnityInput.LookSensitivity.normalized, UnityInput.LookSensitivity.magnitudeThe look sensitivity has a public property that you can use.
"UnityInput.LookSensitivity.GetHashCode()", "UnityInput.LookSensitivity.GetType()", I Only find these two "Get" function, they have nothing to do with sensitivity.LookSensitivity has both a getter and a setter so you can use that.
You can set the property directly:
Code:m_PlayerInput.LookSensitivity = Vector2.zero;
My guess is that this relates to the state overriding the value so you could add the [NonSerialized] attribute to the property to prevent the states from overriding it.Can the sensitivity of this mode be dynamically changed?
Unity's IK system doesn't allow for finger IK. That looks like it could be a humanoid bone mapping issue.2.How to adjust the IK of the finger? My character doesn't have a separate hand model, and the finger IK is incorrect when he holds the gun. I tried to modify it in "Character IK.cs" but did not find the properties of the finger IK. I tried to directly modify the character's finger root in run mode, but it didn't work.
My guess is that this relates to the state overriding the value so you could add the [NonSerialized] attribute to the property to prevent the states from overriding it.
Unity's IK system doesn't allow for finger IK. That looks like it could be a humanoid bone mapping issue.
My guess is that this relates to the state overriding the value so you could add the [NonSerialized] attribute to the property to prevent the states from overriding it.
void setMouseSensitivity()
{
//TODO: playerInput overrides the new value when a zoom occurs. Sensitivity bound to some state triggered by zoom or unzoom.
// The sensitivity goes back to default value of 2.
float mouseSense;
string senseText = dT_MouseSensitivity.text;
mouseSense = float.Parse(senseText, CultureInfo.InvariantCulture);
Vector2 mouseSenseVector = new Vector2(mouseSense, mouseSense);
playerInput.LookSensitivity = mouseSenseVector;
foreach(State state in playerInput.States)
{
if(state.Name == "DefaultOverride")
{
state.Preset.UpdateValue();
}
}
}
Error: Unable to retrieve an updated value - the Get method is null.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.StateSystem.GenericDelegate`1:UpdateValue() (at Assets/Opsive/UltimateCharacterController/Scripts/StateSystem/Preset.cs:251)
Opsive.UltimateCharacterController.StateSystem.Preset:UpdateValue() (at Assets/Opsive/UltimateCharacterController/Scripts/StateSystem/Preset.cs:86)
OptionsManager:setMouseSensitivity() (at Assets/Scripts/Game Management/OptionsManager.cs:44)
OptionsManager:saveOptions() (at Assets/Scripts/Game Management/OptionsManager.cs:26)
UnityEngine.EventSystems.EventSystem:Update() (at F:/Program Files/Unity Installations/2019.2.11f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
My guess is that this relates to the state overriding the value so you could add the [NonSerialized] attribute to the property to prevent the states from overriding it.
It will start at the default preset value, but if no presets modify the property then you can manually change the value as you please. It will not continue to adjust the property.I thought that all properties in the component would be reverted to the Default State when Default State is reached, not just the ones that were modified most recently by a state change.
If you set LookVectorMode to Manual then you have full control and there's no need to override UpdateLookVector. UpdateLookVector doesn't do anything when the LookVectorMode is Manual.Would it be reasonable to ask for the function definition of PlayerInput.UpdateLookVector() to include "protected virtual" in future updates anyways?
That does.. and I really like the idea. I'll add it!does not introduction of a user adjusted multiplier solve this issue simply?