- Home /
"Unknown resolve error"
I wanted to write my own Lerp function because the one came with Unity is behaving weirdly. So I wrote this:
void Update()
{
rigidbody.velocity = PlayerVelocity(rigidbody.velocity, playerRunSpeed);
}
Vector3 PlayerVelocity(Vector3 subjectV, Vector3 targetV)//on this line
{
return (((targetV - subjectV) / 2) + subjectV);
}
...But when I hover over the "subjectV" or "targetV" on the line I marked with the cursor, the tooltip reads "Unknown resolve error". When I hover over the ones IN the function, it reads "The name 'targetV' does not exist in the current context". How come? It's a very simple function, but I seem to be missing something..?
Are you passing playerRunSpeed (presumambly a float/int) into Vector3 targetV?
Does your code work if you ((temp/for debugging) remove the fuction and change it to:
rigidbody.velocity = (playerRunSpeed - rigidbody.velocity) / 2 + rigidbody.velocity
;
Also there are some rules for Vector3 that need the 'new' keyword, I haven't returned a Vector3 in a function but you might need to use the 'new' keyword.
The Lerp in Unity doesn't behave weirdly; it's just (b - a) * t + a
.
Answer by YagoTheFrood · Jan 12, 2014 at 11:17 PM
I solved the problem. As Erich5h5 predicted, it wasn't Lerp's fault, the anomaly was being caused by rigidbody.velocity
. The ACTUAL anomaly was that rigidbody.velocity
would be set to a constant value of (0, 0, 5) instead of tweening towards (0, 0, 100). The problem was fixed when I didn't use rigidbody.velocity
at all, and incremented rigidbody.position
with a velocity I declared myself and Lerp'ed.
I still don't know what the "Unknown resolve error" tooltip was about, but I noticed it pops up when I hover over a lot of other stuff as well, not just subjectV and targetV. I'm assuming it's a bug in Monodevelop.
Answer by elenzil · Oct 21, 2016 at 06:58 PM
posting here for future folks who may search for the same "Unknown Resolve Error".
i got this error in the pop-up when i hovered over a method i had just recently added documentation to. quitting Mono and restarting cleared it up.