void Update () {
Vector3 movement = new Vector3 (deltaX, 0, deltaZ);
movement = Vector3.ClampMagnitude (movement, speed);
movement.y = gravity;
movement *= Time.deltaTime;
movement = transform.TransformDirection(movement);
}
I’m a newbie of Unity3D and C#as well, my question is why the local variable “movement” can be assigned and took effects in separated lines as above, why the assignments of former ones won’t be covered by the latter ones? thanks