I've seen animation speed posts but they don't seem to apply ( or I can figure out how the apply to my issue). I have a simple transform that is moving a ball in a arc point by point. I would like it to go faster, it plays really slow. My input is an initial velocity and an angle, using that I calculate the x and y vectors and use the code below to move the object. It would be cool if my initial velocity could equate to m/s and look that way on the screen, right now the ball just creeps along.
Basically, how do I speed this up or make it so when x = 10 it goes 10 m/s?
transform.position = Vector3(x, y, 0);
//Full code
function FixedUpdate () {
// Check if adjustment needs to be made for Time.time the game clock which is always running
if (timeReset == true) {
// Reset time to 0
newTime = Time.time;
timeReset = false;
yStart = transform.position.y; //Get initial y position of object for displacement calculations
}
if (isPressed == true ) {
// Convert theta and r vector to x y vector
xInitial = velMagnitude * Mathf.Cos(newTheta * Mathf.PI/180);
yInitial = velMagnitude * Mathf.Sin(newTheta * Mathf.PI/180);
// Displacement x,y
x = xInitial * (Time.time - newTime);
y = yStart + (yInitial * (Time.time - newTime)) + (.5 * gravity) * ((Time.time - newTime) * (Time.time - newTime)); // yi+vi*t-1/2*g*t^2
// Move object
//transform.position = Vector3(x, y, 0);
transform.Translate((Time.time - newTime) * x, y, 0);
} else {
isPressed = false;
}
}