Hello, i have 3D game where i added slider which can change sensitivity of camera but when i move slider, camera doesn’t change its sensitivity and that camera is in character which is prefab which is instantiated when game scene start
i tried this but it didnt work
public float sensitivityOfCam;
//declaration
RotationX += Input.GetAxis("Mouse X") * sensitivityOfCam ; // this line is in function which manage mouse input
public void changeSensitivity(float sensitivity) //function which is assigned to slider
{
sensitivityOfCam = sensitivity;
}
Well, the most likely issue I notice is that in your screenshot, instead of using a “dynamic float” callback, you are passing a constant value of “1” regardless of the slider’s value.
But there could be other issues; that’s not a large enough piece of your code to tell.
how can i change it from that constant value to dynamic which will be affected by slider ?
because i was watching some youtube videos about that and they dont even had that value line
To be a little more specific, in the dropdown list where you select which function you want to call when the value changes, functions that accept a float parameter will be listed twice–once near the top of the list under a heading that says “dynamic float”, and then again in the main list with the other eligible functions. To send the slider’s value as the parameter, you need to select the version in the “dynamic float” section.