so, i got this code for some powerup, but it doesn’t work, i have no errors, but the collision detector is broken, i have tried ontriggerenter and oncollisionenter, can someone please why it is not working and fix it? thank you!
using UnityEngine;
using System.Collections;
public class jumpUp : MonoBehaviour
{
CharacterMotor motor;
bool enable;
bool destroy;
void onCollisionEnter(Collider other)
{
motor = GetComponent<CharacterMotor>();
enable = new bool();
destroy = new bool();
enable = true;
destroy = true;
if(enable)
{
motor.jumping.baseHeight = 2.0f;
if (destroy)
{
Destroy(this.gameObject);
}
}
else
{
motor.jumping.baseHeight = 1.0f;
if (destroy)
{
Destroy(this.gameObject);
}
}
}
}