Is it possible to use Mathf.SmoothDamp in C#? I've seen a number of Unityscript examples, but attempting to use the function in C# with an explicit reference to the "currentSpeed" variable brings up an error "Pointers and fixed size buffers may only be used in an unsafe context." I'd rather not run in unsafe mode in case we want to use the webplayer. How should I be calling this function?
The code I'm trying to execute looks like this:
this.newSpeed = Mathf.Clamp (this.newSpeed, 0, throttle * topSpeed);
this._speed = Mathf.SmoothDamp (this._speed, this.newSpeed, & currentVelocity, 1.0f);
and runs inside a coroutine.