help wanted
Hi, I’m new to Unity and I’m trying to make the minigame of Roll-a-Ball.
I’m facing problem even I had followed the tutorial, enter the code to the Visual Studio.
The code
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour
{
private Rigidbody rb;
private float movementX;
private float movementY;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
void OnMove(InputValue movementValue) {
Vector2 movementVector = movementVector.Get<Vector2>();
movementX = movementVector.x;
movementY = movementVector.y;
}
// Update is called once per frame
void FixedUpdate()
{
Vector3 movement = new Vector3(movementX, 0.0f, movementY);
rb.AddForce(movement);
}
}
When going to compile, it shows this:
I can’t figure out what’s wrong it is behind the code.
Hope I can be get help by somebody ; )