summaryrefslogtreecommitdiff
path: root/MoveTransform.cs
blob: 1b135c32083f1219af414cbf6bdbc3ab66f300e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using UnityEngine;

public class MoveTransform : MonoBehaviour
{
	public Vector3 startForce;

	private Vector3 velocity = Vector3.zero;

	public float gravity;

	private void Start()
	{
		velocity = base.transform.TransformDirection(startForce);
	}

	private void Update()
	{
		velocity += Time.deltaTime * Vector3.down * gravity;
		base.transform.position += velocity * Time.deltaTime;
	}
}