I wanted to write my own Lerp function because the one came with Unity is behaving weirdly. So I wrote this:
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…?
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.
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.