I'm trying to figure out why my character isn't moving. I've followed multiple tutorials online with no success. My character never moves.Can I get some help with what is going on?When I put in rb.velocity = new Vector2(horizontal, vertical); it strikes a line through velocity, or force updates to "angularVelocity" and nothing moves. Using Unity 6.2. What's going on?Error CS0029: Cannot implicitly convert type 'UnityEngine.Vector2' to 'float'using System.Collections;using System.Collections.Generic;using JetBrains.Annotations;using UnityEngine;using UnityEngine.InputSystem;public class PlayerMovement : MonoBehaviour{ public float speed = 5; public Rigidbody2D rb; void Update() { float horizontal = Input.GetAxis("Horizontal"); float vertical = Input.GetAxis("Vertical"); rb.velocity = new Vector2(horizontal, vertical); }}
Try using linearVelocity instead of velocity.It's been a while since I've used unity. From looking at the scripting documentation unity has deprecated and gotten rid of the velocity variable in Rigidbody2d some time ago and replaced it with linearVelocity. Why? I dunno.When assigning angular velocity a value i suspect you are giving it the wrong type of value. Angular velocity has the type float and only be assigned floats. If you try to assign a Vector2 it will give you the error in your post.WSR is not the place I would go to for help with game dev programming. In the future try >>>/g/dpt/ >>>/g/sqt/ or >>>/vg/agdg/