Hello. I don’t know what I do wrong but I get the
Assets/Script/playercontroller.cs(11,53): error"CS1525: Invalid expression term ‘)’
when trying to do jump action.
The error code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playercontroller : MonoBehaviour{
Rigidbody2D rigit2D;
float jumpPower = 100.0f;
// Start is called before the first frame update
void Start(){
this.rigit2D = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update(){
if(Input.GetKeyDown(KeyCode.Space))
{
this.rigit2D.AddForce(transform.up * jumpPower);
}
}
}
Please give me reply to resolve this problem.