Answer the question
In order to leave comments, you need to log in
What to do with error CS1061 on Unity?
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. Learn to ask questions. If you answer the question from the title, then the answer will be "Do whatever you want, you can leave it as it is and admire it"
2. Learn to read the rules and make posts in accordance with them.
Here where here for example language D? I can clearly see that there is C# with Unity. There is also no layout.
RigidBody does not have an addForce method.
List of all available methods here: https://docs.unity3d.com/ScriptReference/Rigidbody.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question