My Personal Project
- Keshav Batra
- Oct 21, 2022
- 1 min read
So I've made some progress on my 3D jump platform game. I added the jumping function for the player and the disappearing platforms for when I land on it. I've still got to work on having all the platforms disappear one by one. I made the player jump by reducing the mass
Platform disappear script
{
public GameObject Platform;
private void OnTriggerEnter(Collider collision)
{
Destroy(Platform);
}
}
Jump script
{
private float Jump;
public float JumpAmount = 200;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
GetComponent<Rigidbody>().AddForce(Vector3.up * JumpAmount * Time.deltaTime); //Forces the player to jump upwards based on the additon of the JumpAmount
}
}
}
So far the end result looks like this:
Its hard to make out but one of the platforms has disappeared and the jumping has occurred.
Comments