I need somebody to finish my player script. Please help with the jump. I’ve tried looking everywhere, but can’t find an easy jump script to copy. That’s all I need just a simple smooth jump script.
Here’s my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player2 : MonoBehaviour {
public GameObject Player;
public GameObject respawn;
public Vector3 pos;
// Use this for initialization
void Start () {
Player = GameObject.Find ("ArrowsPlayer");
respawn = GameObject.Find ("ArrowsPlayerRespawn");
pos = respawn.transform.position;
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.RightArrow)) {
Player.transform.Translate(Vector3.right * 4.0f * Time.deltaTime);
}
if (Input.GetKey (KeyCode.LeftArrow)) {
Player.transform.Translate(Vector3.left * 4.0f * Time.deltaTime);
}
if (Input.GetKey (KeyCode.UpArrow)) {
}
}
void OnTriggerEnter(Collider other) {
if (other.gameObject.name == "killzone") {
Player.transform.position = pos;
}
}
}