Script Error

Assets/Scripts/playerControl.cs(95,25): error CS0200: Property or indexer playerControl.velocity' cannot be assigned to (it is read only)** **Assets/Scripts/playerControl.cs(47,33): error CS1612: Cannot modify a value type return value of playerControl.impulse’. Consider storing the value in a temporary variable
Assets/Scripts/playerControl.cs(46,33): error CS1612: Cannot modify a value type return value of playerControl.impulse'. Consider storing the value in a temporary variable** **Assets/Scripts/playerControl.cs(45,33): error CS1612: Cannot modify a value type return value of playerControl.impulse’. Consider storing the value in a temporary variable

are the errors i am getting

2253969–150630–playerControl.cs (3.98 KB)

Impossible to say without seeing the script. The errors give line numbers, you should start there.

i added the script as a attached file

now it is on the one on line 95

http://pastebin.com/05PDBvyc

Well first off in your update method you put " velocity = " however velocity is defined as a read only property. The other errors are because Vector 3 is a struct and transform.position is a getter method. You’d have to change it to:

Vector3 temp = transform.position;
temp.x = Mathf.Clamp (value.x, 0, maxImpulse.x);
temp.y = Mathf.Clamp (value.y, 0, maxImpulse.y);
temp.z = Mathf.Clamp (value.z, 0, maxImpulse.z);
transform.position = temp;