T
T
terguew562022-01-20 18:19:03
C++ / C#
terguew56, 2022-01-20 18:19:03

How to fix error CS1001?

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

public class NewBehaviourScript : MonoBehaviour
{
    [SerializeField] private float _speed;
    private Vector3 _input;

    private Rigidbody2D ..rigidbody;

    private void Start(); 
    {        
        _rigidbody = GetComponent<Rigidbody2D>();
    }

    private void FixedUpdate();
    {
    	move();
    }

    private void move();
    {
    	_input = new Vector2(Input.GetAxis("Horizontal"), 0);
        _rigidbody.AddForce(_input * _speed);  
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-01-20
@vabka

Learn to compose a question)
If you answer the question from the title

I have error CS1001?

Then yes.
And if specifically, then here you need to remove the dots
private Rigidbody2D ..rigidbody;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question