- Home /
Rotating Platform Slows Down Upon Collision
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?
Comment
Your answer
Follow this Question
Related Questions
Rotating Platform Collision Issue 1 Answer
GUI refresh time on platforms slower than Unity Editor 1 Answer
Rotating based on the platform the player is standing on? 2 Answers
Making Rigidbodies the parent of character controllers is giving me problems. 1 Answer
Spinning rigidbody platform in 2D 0 Answers