using UnityEngine;
using System.Collections;
public class YSpeed : MonoBehaviour {
KeyCode moveUp;
KeyCode moveDown;
float speed = 10;
void Update (){
if (CFInput.GetKey(moveUp))
{
rigidbody.velocity.y = speed;
}
else if (CFInput.GetKey(moveDown))
{
rigidbody.velocity.y = speed *-1;
}
else
{
rigidbody.velocity.y = 0;
}
}
}
it’s says ‘Cannot modify a value type return value of `UnityEngine.Rigidbody.velocity’. Consider storing the value in a temporary variable.’
It was Javascript at the first and im trying to convert to C#.