I am following the project space shooter of unity’s completed projects but I have a problem with Mathf.Clamp taking float values as arguements where as the tutor in the video doesnt seem to have
any problem with it.Here’s the code I’ve written.
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis(“Horizontal”);
float moveVertical = Input.GetAxis(“Vertical”);
Vector3 movement =new Vector3(moveHorizontal, 0.0f, moveVertical) ;
rigidbody.velocity = movement * speed;
rigidbody.position = new Vector3(Mathf.Clamp(rigidbody.position,xmin,xmax),
0.0f,
Mathf.Clamp(rigidbody.position,zmin,zmax));
}
everything inside Vector3 is squiggly lined apart from 0.0f
Thanks in advance…!