✅ error CS1513: } expected in unity
i get "error CS1513: } expected" for this script in unity pls help:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
private PlayerInput playerInput;
private PlayerInput.OnFootActions onFoot;
private.PlayerMotor motor;
// Start is called before the first frame update
void Awake()
{
playerInput = new PlayerInput();
onFoot = playerInput,OnFoot;
motor = GetComponent<PlayerMotor>();
}
// Update is called once per frame
void FixedUpdate()
{
//tell the playermotor to move using the value from our movement action
motor.ProcessMove(onFoot.movement.ReadValue<Vector2>());
}
private void OnEnable()
{
onFoot.Enable();
}
private void OnDisable()
{
onFoot.Disable();
}
}
14 Replies
private.PlayerMotor
"."
yes but that gives me error CS1519
Invalid token '.'
in the code you shared, you appear to have an unnecessary period at the point im mentioning
it should likely be converted into a space
so private PlayerMotor
not private.PlayerMotor?
also "playerInput,OnFoot" is bad too
we dont use commas like that
oof the fact that you don't know these things and don't have these errors at an IDE level is very telling
i already fixed that
well not in the code you shared
yeah sorry
and as ero is mentioning, you should really learn how to code C# and handle compiler errors before you jump into Unity and try to make a game
bruh i removed period and now have another error CS1061 bruh
yeah i probably should
it is like you dont know how to swim yet and you are jumping in the deep end.
I would recommend you download Visual Studio if you haven't already and make some beginner level projects to learn C#. then when you are comfortable jump back into this project in unity
alr thanks
If there are no questions left, consider closing this thread using /close