Answer the question
In order to leave comments, you need to log in
How to fix error CS0019?
The + operator cannot be assigned to Vector2
This code used to work, but it also stopped please help.
public float speed=20f;
private Rigidbody2D Rb { get; }
private Vector2 Vector2 { get; }
void Start()
{
_ = Rb == GetComponent();
}
void Update()
{
float moveX = Input.GetAxis("Horizontal");
object p = Rb.MovePosition(Rb.MovePosition + (Vector2.right * moveX * speed * Time.deltaTime)); // error
}
}
Answer the question
In order to leave comments, you need to log in
and the method does not return anything. see
docs https://docs.unity3d.com/ScriptReference/Rigidbody...
This code used to workhe could not work exactly in this form
code
site rules requirement tag, and it's easier to read Unity
to the question onUnity
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question