- Home /
Getting "API update required"
Im doing the Roll-A-Ball project and am on moving the player (http://unity3d.com/learn/tutorials/projects/roll-a-ball/moving-the-player). I checked and it it the same as what he put in but when I try to save it and enter unity again I just get "Obsolete API". What should I do?
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour
{
void FixedUpdate ()
{
float moveHorizonal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizonal, 0.0f, moveVertical);
rigidbody.AddForce(movement);
}
}
This is a Unity 4 tutorial. Try running the API updater.
Hi, I have the same problem, Unity changed that line for me but now it says:
Some scripts have compilation errors which may prevent obsolete API usages to get updated. Obsolete API updating will continue automatically after these errors get fixed.
I´ve watched 50+ hours of videos about Unity, the 3 beginners tutorials, all the scripting, UI, and 2D topics and some Yt videos with more tutorials, all before even touching the program in order to learn first and practice later.
Can you please help me, I really, really want to learn Unity but I have no idea what is wrong.
Thanks
$$anonymous$$
I also experienced the API Update. I attached the following error. I am using a code which is not supported with Unity 5.
What must i do?
Answer by Kiwasi · Mar 09, 2015 at 05:17 AM
The main changes are in the shortcut methods. It was a breaking change between 4.x and 5.0. To fix replace line 13 with
GetComponent<Rigidbody>().AddForce(movement);
Your answer
