I have a script that I have made from a tutorial and it says that unity does not know the definition of velocity what is wrong? the script is below
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MouseController : MonoBehaviour {
public float forwardMovementSpeed = 3.0f;
public float jetpackForce = 75.0f;
private Rigidbody2D rb2d;
void Start () {
rb2d = GetComponent<Rigidbody2D>();
}
void Update () {
}
void FixedUpdate ()
*{Vector2 newVelocity = rigidbody2D.velocity;*
newVelocity.x = forwardMovementSpeed;
***rigidbody2D.velocity = newVelocity;***
bool jetpackActive = Input.GetButton("Fire1");
if (jetpackActive)
{
rb2d.AddForce(new Vector2(0, jetpackForce));
}
}
}