how to know the modified codes for unity 5.2.2f1 ?

I was trying to run the roll a ball code, I followed all the steps in the exact same manner as they were shown in the tutorial, but still the code was not running, this was the code:
public float speed;
private Rigidbody rb;

void Start ()
	rb = GetComponent<Rigidbody> ();

void fixedUpdate ()
	float moveHorizontal = Input.GetAxis ("Horizontal");
	float moveVertical = Input.GetAxis ("Vertical");

	Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

	rb.AddForce (movement*speed);

but before askin g this question bcoz of suggestions, I realized that the code has been modified for the new version to:

public float speed;

private Rgidbody rb;

void FixedUpdate()

float moveHorizontal = Input.GetAxis("Horizontal");

float moveVertical = Input.GetAxis("Vertical");

Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);


and now everything is working fine.

Please tell me how to know the modified codes, since tutorials don’t care about it.

Any help will be highly appreciated, Thanks in advance…!!!

Its nonsense and you can ignore it.

Your first version is fine.

Unity 5 introduced a code updater that simply make sure to add proper references for components which used to have shortcuts.

For example, simply saying rigidbody used to refer to the rigidbody on the object. Now you are forced to do it manually but the caching in Start method works perfectly and does not need to be changed.

Use the first one. Its faster.

The change that actually fixed your script has nothing to do with Unity 5. The script actually had incorrectly named the method “fixedUpdate” instead of “FixedUpdate”. Case matters, especially for Unity special methods.

So just changing that in your original script would have fixed your problem. In fact, like meat5000 suggested, the first version is better because it caches the Rigidbody.

Thanks a lot, I just changed the ‘f’ of ‘fixedUpdate’ to ‘F’, and the code worked nicely,
And indeed that first code is faster and convinient.