I made the game for windows it just perfect but now i want to make it for android
so what should i change in the script tto make it run for android ls explain in easy steps
public class Player : MonoBehaviour
{
// The force which is added when the player jumps
// This can be changed in the Inspector window
public Vector2 jumpForce = new Vector2(0, 300);
// Update is called once per frame
void Update ()
{
// Jump
if (Input.GetKeyUp("space"))
{
rigidbody2D.velocity = Vector2.zero;
rigidbody2D.AddForce(jumpForce);
}
// Die by being off screen
Vector2 screenPosition = Camera.main.WorldToScreenPoint(transform.position);
if (screenPosition.y > Screen.height || screenPosition.y < 0)
{
Die();
}
}
// Die by collision
void OnCollisionEnter2D(Collision2D other)
{
Die();
}
void Die()
{
Application.LoadLevel(Application.loadedLevel);
}
}
But can't it be little easier Pls explain in kinda like am a newbie to unity it's just like 1.5 months Pls
– dark-missileAs you asked elsewhere where to drag the script to and where the drop down is. http://i.imgur.com/TMqfuiB.png Click + in the OnClick part and you should get a slot appear with a dropdown to the right of it.
– Mmmpies