I added Rigidbody to my cube and now it goes super fast when i move!
Hey im pretty new to developing games but im having this problem where i add rigidbody to my player so i can have gravity but i go super fast when i press one of the arrows(The set movement keys) but i will leave my code below also i use C#
All the settings on the rigidbody are default
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerControls : MonoBehaviour {
public float movespeed;
// Use this for initialization
private void Start () {
movespeed = 6f;
}
// Update is called once per frame
private void Update ()
{
transform.Translate(movespeed*Input.GetAxis("Horizontal")*Time.deltaTime,0f,0f);
}
}
Comment
Your answer
Follow this Question
Related Questions
GravityBody hides Rigidbody 1 Answer
Gravity is not working 0 Answers
Change player gravity by pressing a key? 1 Answer
Adding Gravity to a game object to make a black hole sucking effect. 1 Answer
Rigid Body and Collision 1 Answer