C
C#2y ago
Paddy

✅ 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
ZacharyPatten
ZacharyPatten2y ago
private.PlayerMotor "."
Paddy
PaddyOP2y ago
yes but that gives me error CS1519 Invalid token '.'
ZacharyPatten
ZacharyPatten2y ago
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
Paddy
PaddyOP2y ago
so private PlayerMotor not private.PlayerMotor?
ZacharyPatten
ZacharyPatten2y ago
also "playerInput,OnFoot" is bad too we dont use commas like that
ero
ero2y ago
oof the fact that you don't know these things and don't have these errors at an IDE level is very telling
Paddy
PaddyOP2y ago
i already fixed that
ZacharyPatten
ZacharyPatten2y ago
well not in the code you shared
Paddy
PaddyOP2y ago
yeah sorry
ZacharyPatten
ZacharyPatten2y ago
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
Paddy
PaddyOP2y ago
bruh i removed period and now have another error CS1061 bruh yeah i probably should
ZacharyPatten
ZacharyPatten2y ago
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
Paddy
PaddyOP2y ago
alr thanks
Denis
Denis2y ago
If there are no questions left, consider closing this thread using /close
Want results from more Discord servers?
Add your server