Search Unity

identifier expected error

Discussion in 'Scripting' started by Heroic_Carp, Oct 9, 2019.

  1. Heroic_Carp

    Heroic_Carp

    Joined:
    Oct 9, 2019
    Posts:
    2
    so I'm very new to any form of coding and don't really know what I'm doing.
    i have been learning slowly but don't know what to do here.

    it keeps telling me that there is an identifier expected.

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

    public class playermovement : MonoBehaviour
    {
    public float moveSpeed = 5f;

    public Rigidbody2D rb;

    Vector2 movement;

    // Update is called once per frame
    void Update()
    {
    movement.x = Input.GetAxisRaw("Horizontal");
    movement.y = Input.GetAxisRaw("Vertical");
    }
    void FixedUpdate();
    rb.MovePosition rb.Position (movement * moveSpeed , Time.fixedDeltaTime);




    }



    there are probably a lot of errors I'm not aware of but i have tried to find the answer but just cant figure it out.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Please check out the code formatting guidelines, first post in this forum.
     
  3. Heroic_Carp

    Heroic_Carp

    Joined:
    Oct 9, 2019
    Posts:
    2
    So apparently i fixed it. I just fiddled around doing different stuff and it is no longer a problem. I don't really know what I did but it seems to be fine now.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Well the good news is, the longer you program, the larger the percentage of "knowing what you did."

    I've been programming for 41 years and I think I'm almost at 50% "knowing what I did."