- Home /
RigidBody Question
can you make a rigidbody stay at a certain pace so it does not speed up or slow down it stays at one speed because im trying to make a guitar hero like game and it wont match the songs notes if the rigidbodies are faster then the music. thanks and please comment.
Answer by aldonaletto · Oct 02, 2011 at 06:49 PM
You can set rigidbody.velocity constantly at FixedUpdate - this will avoid physics effects like drag:
var xSpeed: float = 0; // speed in the X axis
function FixedUpdate(){ rigidbody.velocity = Vector3(xSpeed, 0, 0); } You should also set rigidbody.freezeRotation to true, or your rigidbody may start rotating crazily after touching anything.
thank you so much ill i did is freze y and z and worked perfect your the best i am finally going to be able to make a game since i made my own score script thanks a bunch :)