Vector3 and velocityQuestion


I am remaking the script from Unity’s Sample Assets to the first person character in JavaScript. But I get a problem that I can’t fix! So if anyone could fix it, please tell me.

So I need to convert this line to JavaScript.

Vector3 velocityChange = velocity - prevVelocity;

The error I can is that it is missing a ‘;’

In Javascript you would use var:

var velocityChange = velocity - prevVelocity;

Or if you want an explicit type:

var velocityChange : Vector3 = velocity - prevVelocity;