I’m trying to make my own game for the first time in my life im doing this and i was trying to get movement in this game.
I wanted movement where the player moved but the camera was fixated in thee room with a tutorial i found on yt and i dont know if i can post the link there so i wont but i was copiyng the code word for word and the guy from the vid and i used visual studio code but for me it was a bit diffrent and the video is a couple of months old i think like 2 or something but anyway i copied everything he showed and now the error
Assets\Scripts\PlayerMovement.cs(40,61): error CS1001: Identifier expected
appears and i dont know how to fix it.
I dont know how to show the code but i think i will just post the code as an answer
can anyone help?
btw im almost 14 and new to coding so i dont really know what to do
the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
CustomInput input = null;
Vector2 moveVector = Vector2.zero;
void Awake()
{
input = new CustomInput();
}
void OnEnable()
{
input.Enable();
input.Player.Movement.performed += OnMovementPerformed;
input.Player.Movement.canceled += OnMovementCancelled;
}
void OnDisable()
{
input.Disable();
input.Player.Movement.performed -= OnMovementPerformed;
input.Player.Movement.cancelled -= OnMovementCancelled;
}
void FixedUpdate()
{
Debug.Log(moveVector);
}
void OnMovementPerformed(InputAction.CallbackContext value)
{
moveVector = value.ReadValue<Vector2>();
}
void OnMovementCancelled(InputAction.CallbackContext)
{
moveVector = Vector2.zero;
}
}