I want my character to jump in a sort of arch path. is there a nice snippet of code that lets me do this?

I suck at coding and I’m trying to familiarize myself with the API. Personally, I would prefer that someone just show me the class(es) that allows me to do just this (in the API).A sort of, teach a man to fish sort of solution. But any solution that generates a curved path for my character would be helpful at the least. As for the code…

using UnityEngine;
using System.Collections;

public class twoDmovment : MonoBehaviour {

void Start(){}
void Update(){

	if (Input.GetKey (KeyCode.W))
		transform.position += new Vector3 (0.0f, 0.05f,0.0f);
	if (Input.GetKey (KeyCode.A))
		transform.position -= new Vector3 (0.01f, 0.0f, 0.0f);
	if (Input.GetKey (KeyCode.S))
		transform.position += new Vector3 (0.0f, 0.01f, 0.0f);
	if (Input.GetKey (KeyCode.D))
		transform.position += new Vector3 (0.01f, 0.0f, 0.0f);
}

}

Any help involving coding would be extremely appreciated too. Glancing at my code, you can possibly see i have a lot to learn about API’s and just the general languages.

hi…i actually get this code from other sites. if i understood your question i hope it can help you.Otherwise just let me know more i can help you out.

Vector3 FirstPos = new Vector3(0, 0, 0);
		Vector3 LastPos = new Vector3(0, 0, 10);
		float trajectoryHeight = 5;
		// calculate current time within our lerping time range
		float cTime = Time.time * 0.2f;
		// calculate straight-line lerp position:
		Vector3 currentPos = Vector3.Lerp(FirstPos, LastPos, cTime);
		if (Input.GetKey (KeyCode.W)) {
			// add a value to Y, using Sine to give a curved trajectory in the Y direction
			currentPos.y += trajectoryHeight * Mathf.Sin (Mathf.Clamp01 (cTime) * Mathf.PI);
		
			// finally assign the computed position to our gameObject:
			transform.position = currentPos;
		}