Answer the question
In order to leave comments, you need to log in
An embedded statement cannot be a declaration or a statement with an identifier. how to solve this error?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PleyerControl : MonoBehaviour {
public float speed = 10f;
private Rigidbody2D rb;
void Start () {
rb = GetComponent <Rigidbody2D> ();
}
void Update () {
float moveX = Input.GetAxis ("Horizontal");
rb.MovePosition (rb.position + Vector2.right * speed * moveX * Time.deltaTime);
if (input.GetKeyDown (KeyCode.Space))
rb AddForce = (Vector2.Up * 8000);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question