using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Playercontroller : MonoBehaviour {
public Rigidbody playerRigidbody;
public float speed;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
playerRigidbody.AddForce(movement * speed * Time.deltaTime);
}
}
so this is the script i used, i have followed the what the video did i guess, entered the speed, checked the input part, and there isnt even any error popping up. however when i play it nothing happens (no change of value in the position and rotation) basically i have done almost all i can but it just doesnt work… i would really really appreciate if anyone can help me as i’m completely new in coding and unity… thank you so much