Need help with 4 scripting errors
Need help with scripting errors. I'm creating a game for school, and I'm more of an animator. Its a 2D fighter.
Unity is stating void start is an error because of void. if I delete void, it still gives an error, if I delete the line I still get an error. Not sure what I'm doing wrong
// Use this for initialization
void Start()
void Update()
{
AttackInput ();
ScaleCheck();
OnGroundCheck();
Damage();
UpdateAnimator();
}
Unity is stating float is an error, if I remove float it creates jmpduration as error, and creates additional errors.
public float JumpForce = 20; public float jumpDuration = .1f float jmpduration float jmpforce; bool jumpKey; bool falling; bool onGround;
repeats same error above?
Unity states unexpected symbol {
public class DamageScript : MonoBehaviour { void OnTriggerEnter2D(Collider2d col) { if(col.transform.root != transform.root && col.tag != "Ground" && !col.isTrigger) { < MARKED UNEXPECTED if(!col.transform.GetComponent().damage { col.transform.GetComponent().damage = true;
col.transform.root.GetComponentInChildren<Animator>().SetTrigger("Damage");
}
}
}
Can anyone help me fix these?
If you need help with a school project, you should really ask your $$anonymous$$cher. I'm not trying to be obtuse - I'm a lecturer in game development myself - your $$anonymous$$cher needs to know when you get stuck so that they can help you, but also to help them know that perhaps they didn't explain that bit of the course material well enough.
Note that none of your problems are specific to Unity - they're all general program$$anonymous$$g mistakes you've made either through lack of attention to detail or lack of understanding. The most useful skill your $$anonymous$$cher can give you is how to interpret those error messages so you can fix future problems on your own.
Your answer
![](https://koobas.hobune.stream/wayback/20220612065907im_/https://answers.unity.com/themes/thub/images/avi.jpg)