Quantcast
Channel: Questions in topic: "rotating"
Viewing all articles
Browse latest Browse all 173

Rotating Platform Slows Down Upon Collision

$
0
0
I have a script to rotate a platform: using UnityEngine; using System.Collections; public class RotatingPlatform : MonoBehaviour { public float speed = 10f; public float baseSpeed = 10f; void Update () //stop time mechanic. When SHIFT is pressed, the object stops. { if(Input.GetKeyDown(KeyCode.LeftShift)) { speed = 0f; } else if(Input.GetKeyUp(KeyCode.LeftShift)) { speed = baseSpeed; } } void FixedUpdate () //rotation { transform.Rotate(Vector3.up, speed * Time.deltaTime); } } ` However, when the player collides with the platform, its rotation speed drastically slows. What is wrong with the code?

Viewing all articles
Browse latest Browse all 173

Trending Articles



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