Question is off-topic or not relevant
I get error CS0119 and I don't know why?
I keep getting error CS0119: Expression denotes a 'type', where a variable, value, or method group was expected when writing this script. Any help would be appreciated. This is for line 13 of the code
void FixedUpdate ()
{
if (dead)
{
return;
GetComponent<Rigidbody2D> ().AddForce (Vector2.up * upSpeed);
didFlap = false;
}
if (GetComponent< Rigidbody2D> ().velocity.y > 0) {
transform.rotation = Quaternion.Euler (0, 0, 0);
} else
{
float angle = Vector3(Mathf.Lerp (0, -90, (-Rigidbody2D.velocity.y / 3f)));
transform.rotation = Quaternion.Euler(0,0, angle);
}
}
void OnCollisionEnter2D(Collision collision)
{
if (godMode)
return;
GetComponent<Animator>() .SetTrigger ("Death");
dead = true;
deathCooldown = 0.5f;
}
}
Answer by Firedan1176 · Dec 22, 2015 at 01:32 AM
You've got Vector3
, but you're not declaring that as a new
Vector3. Even if you replace Vector3
with new Vector3
, it should not work because float
and Vector3
are not the same data types.
I think you're looking for: Vector3.Angle();
But still, you'll need to pass in 2 Vector3's, not just 1. I'm not entirely sure what you want to do, so if you could describe what you are wanting to happen, I could possibly help you better! Good luck.
Follow this Question
Related Questions
Manually created gravity too powerful 0 Answers
Help with Error Code CS0019 2 Answers
Object reference not set to an instance of an object (c#) 0 Answers
ERROR Loading Script! WHAT'S WRONG?? 2 Answers