- Home /
Question by
awesomesid123 · Jul 19, 2018 at 06:45 PM ·
physicsrigidbodyplayer movement
Camera becomes shaky on collision
So I have made a simple movement script which works fine until I collide into an object. The camera becomes shaky and starts to vibrate a lot. The player even moves backward. Please help me out.
Movement Script: public class Movement : MonoBehaviour { public float speed = 20; public Rigidbody rb;
void Update()
{
var x = Input.GetAxis("Horizontal") * Time.deltaTime * 150.0f;
var z = Input.GetAxis("Vertical") * Time.deltaTime * 20.0f;
var x2 = Input.GetAxis("Horizontal") * Time.deltaTime * 20.0f;
transform.Rotate(0, x, 0);
transform.Translate(x2, 0, z);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612171105im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
transform.forward not always forward? 2 Answers
Issue with Instantiate and the instant that spawns on a moving object that rotates 1 Answer
How to apply a force after launching the player? 0 Answers
Stop rigidbody player from juddering when walking into a wall. 0 Answers
R-Type style movement 0 Answers