I am currently trying to make my character aim up, aim neutral and aim down based on mouse position/movement but I do not want to base it on mouse speed/velocity.
It is hard for me to explain the problem or question is so I will just show you a diagram of what I want to do.
See attached image.
function Aim(){
var mousePos = Input.mousePosition.y;
if(Input.GetButton("Zoom")){ //Zoom is right click
animator.SetFloat("MouseAimY", mousePos); //This will put the number from mouse position (Y axis) coordinate into the parameter.
}
}
Thanks for the reply. I do not know what you mean by dividing mousePosition by Screen.height. Like where do I apply it on my script? What to replace or remove?
Thank you.
EDIT: I looked at the Unity docs, it did not gave me an example.
I am new to coding so I learn from using examples and reverse-engineering.