Hello all! im sure im not the first to come here with these questions, but im at the early stage where i dont even know what to google to get answers. I have my code here and for the life of me it looks identical to the code shown in roll a ball tutorial part 2 step 7. ‘Apply force to the Player’
Below is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
private Rigidbody rb;
private float movementX;
private float movementY;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
rb = GetComponent<Rigidbody>();
}
void OnMove(InputValue MovementValue)
{
Vector2 MovementVector = MovementValue.Get<Vector2>
movementX = MovementVector.X;
movementY = MovementVector.Y;
}
void fixedupdate()
{
Vector3 movement = new Vector3 (movementX, 0.0f, movementY);
rb.addforce(Movement);
}
}
now i can tell something is off as my ‘vector2’ text on line 23 doesnt turn green as theirs does in the tutorial, but again, i dont know were to start in looking to fix this.
All in all i get flagged with 6 errors when tryin gto run this code
- Assets\Scripts\PlayerController.cs(23,52): error CS0119: ‘Vector2’ is a type, which is not valid in the given context
- Assets\Scripts\PlayerController.cs(25,36): error CS1061: ‘Vector2’ does not contain a definition for ‘X’ and no accessible extension method ‘X’ accepting a first argument of type ‘Vector2’ could be found (are you missing a using directive or an assembly reference?)
- Assets\Scripts\PlayerController.cs(26,36): error CS1061: ‘Vector2’ does not contain a definition for ‘Y’ and no accessible extension method ‘Y’ accepting a first argument of type ‘Vector2’ could be found (are you missing a using directive or an assembly reference?)
- Assets\Scripts\PlayerController.cs(25,21): error CS0165: Use of unassigned local variable ‘MovementVector’
- Assets\Scripts\PlayerController.cs(34,20): error CS0103: The name ‘Movement’ does not exist in the current context
- Assets\Scripts\PlayerController.cs(34,11): error CS1061: ‘Rigidbody’ does not contain a definition for ‘addforce’ and no accessible extension method ‘addforce’ accepting a first argument of type ‘Rigidbody’ could be found (are you missing a using directive or an assembly reference?)
Im sorry if this looks like alot for you (imagine how it looks for me)
I am working on unity 6 on the day of posting this
Any and all help would be very appreciated, hitting such a unexpected wall so early has been quite disheartening
Thank you


