I am a noob when it comes to c#, but i am getting new errors everytime i post a question about the previous question, so i thought: maybe someone can clean this script up, i am using the caracter motor from the standard assets and i want to change the value of jumpHeight because one platform has a powerup but that platform is higher than the players origional jump, so the player needs a powerup with this script, but this script doesn’t work, i think the problem lies in the ‘caracterMotor motor;’ line, so my question is: can someone PLEASE fix this? thank you!
using UnityEngine;
using System.Collections;
public class jumpUp : MonoBehaviour
{
private CharacterMotor motor;
public GameObject player;
public bool enable;
public bool destroy;
void start(){
motor = player.GetComponent<CharacterMotor>();
bool enable = true;
bool destroy = true;
}
void OnTriggerEnter(Collider other)
{
if(enable == true){
motor.jumping.baseHeight = 2.0f;
Destroy(gameObject);
}
else
{
motor.jumping.baseHeight = 1.0f;
Destroy(gameObject);
}
}
}