Quantcast
Channel: Questions in topic: "moving-platforms"
Viewing all articles
Browse latest Browse all 16

Moves on collision

$
0
0
I am making a moving platform, and whenever my player gets on it, it starts flipping around. It also slowly rotates if I just leave it for a while. I want it to stay at the same rotation, but still move and be solid. This is my code for it: void FixedUpdate () { if (directionality == 1) { Vector3 movement = new Vector3 (-1.0f, 0.0f, 0.0f); rigidbody.velocity = movement * speed * Time.deltaTime; } if (directionality == 2) { Vector3 movement = new Vector3 (0.0f, 0.0f, 1.0f); rigidbody.velocity = movement * speed * Time.deltaTime; } }

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>