'error in code saying: Assets\Grabbing.cs(19,45): error CS1503: Argument 1: cannot convert from 'UnityEngine.Quaternion' to 'float'
I am working on a Ragdoll game and I watched a tutorial. But I got one error in a code and it says:
Assets\Grabbing.cs(19,45): error CS1503: Argument 1: cannot convert from 'UnityEngine.Quaternion' to 'float'
I don't get it.
This is my code:
void Update()
{
Vector3 playerpos = new Vector3(cam.ScreenToWorldPoint(Input.mousePosition).x, cam.ScreenToWorldPoint(Input.mousePosition).y, 0);
Vector3 difference = playerpos - transform.position;
float rotationZ = Mathf.Atan2(difference.x, -difference.y) * Mathf.Rad2Deg;
if (Input.GetKey(mousebutton))
{
rb.MoveRotation(Mathf.LerpAngle(rb.rotation, rotationZ, speed * Time.fixedDeltaTime));
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
