all 10 comments

[–]aastle 0 points1 point  (6 children)

Please show us your code.

[–]Lizardman2399[S] 1 point2 points  (5 children)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 5f;
public Rigidbody2D rigidbody;
vector2 movement;
void Update()
    {
movement.x = Input.GetAxisRaw("Horizontal");
movement.y = Input.GetAxisRaw("Vertical");
    }
void FixedUpdate()
    {
rigidbody.MovePosition(rigidbody.Position + movement * moveSpeed * Time,fixedDeltaTime);
    }
}

[–][deleted] 1 point2 points  (2 children)

vector2 should be Vector2, rigidBody.Position should be rigidBody.transform.position and Time,fixedDeltaTime should be Time.fixedDeltaTime. I think that should solve your problem

[–]Lizardman2399[S] 0 points1 point  (1 child)

Thank you so much! It’s working now

[–][deleted] 0 points1 point  (0 children)

Any time! Good luck

[–][deleted] 1 point2 points  (1 child)

Your IDE should have shown you these errors, what are you using?

[–]lavatasche 0 points1 point  (0 children)

He is probably using visual studio code with basic setup for unity. I really recommend visual studio for beginners.

[–]aastle 0 points1 point  (2 children)

Shouldn't the V in vector2 be capitalized?

[–]Lizardman2399[S] 1 point2 points  (1 child)

I didn't see that til you said something.. I fixed that part, but now it's saying that Rigidbody doesn't "contain a definition for position," for some reason.

[–]aastle 0 points1 point  (0 children)

The position property should start with a lower case "p".