I made a program using javascript, but I am curently learning C# so I wanted to transfer
it over. I think I fixed most of the problems but this one:
Cannot modify a value type return value of `UnityEngine.Rigidbody.velocity’. Consider storing the value in a temporary variable
using UnityEngine;
using System.Collections;
public class MYCLASSNAME : MonoBehaviour
{
int rotationSpeed= 100;
int jumpHeight= 8;
bool isFalling = false;
void Update ()
{
//Left to Right, A and D
float rotation = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque(Vector3.back * rotation);
if (Input.GetKeyDown (KeyCode.Space) && isFalling == false)
{
rigidbody.velocity.y = jumpHeight;
}
isFalling = true;
}
void OnCollisionStay ()
{
isFalling = false;
}
}