I need help with this code

It always says
Assets\Scripts\PlayerConntroler.cs(6,46): error CS1003: Syntax error, ‘,’ expected

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class PlayerConntroler : MonoBehaviour
{
public float speed = 10;
private RigidBody rb;
private float movementX;
private float movementY;

// Start is called before the first frame update
void Start()
{
rb = GetComponent();
}
void OnMove(InputValue movementValue)
{
Vector2 movementVector = movementValue.get();

movementX = movementVector.x;
movementY = movementVector.y;
}

Void FixedUpdate()
{
Vector3 momevent = new Vector3(movementX, 0.0f, movementY);

rb.AddForce(movement * speed);
}
}

I hate to be pedantic but it could be because you spelt controller wrong :smile:

@unity_0nTJbMZv-YZG0Q
Welcome to community.

Please use Edit code
** Using code tags properly **

For second, if you use VS, you should see multiple red lines, which you need fix first.
For example, there is no Void, but void instead.
But that is not only issue you have in your code.

Did you actually wrote it by yourself?

1 Like