So, im getting this error message:
Assets\PlayerMovement.cs(56,21): error CS1002: ; expected
but if i put a ; where it wants i get a whole lot of other error messages, and now im wondering what im supposed to do.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float Speed;
public float JumpPower;
private Rigidbody2D RB;
private float _startJumpPower;
// Start is called before the first frame update
void Start()
{
RB = GetComponent<Rigidbody2D>();
_startJumpPower = JumpPower;
}
// Update is called once per frame
void Update()
{
Vector2 movement = new Vector2(0, RB.velocity.y);
if (Input.GetKey(KeyCode.A))
{
movement.x = -Speed*Time.deltaTime;
}
else if (Input.GetKey(KeyCode.D))
{
movement.x = Speed*Time.deltaTime;
}
RB.velocity = movement;
if (Input.GetKeyDown(KeyCode.Space))
{
RB.AddForce(new Vector2(0, JumpPower));
}
}
public void JumpPowerUp(float seconds, float jumpPower)
{
StartCoroutine(RunJumpPowerUP(seconds, JumpPower));
}
IEnumerator RunJumpPowerUP(float seconds, float jumpPower)
{
JumpPower = jumpPower;
yield retun new WaitForSeconds(seconds);
JumpPower = _startJumpPower;
}
}