Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FixedUpdate ()
- {
- transform.Translate(Vector3.up * currentSpeed * Time.deltaTime);
- float newManeuver = Mathf.MoveTowards (rb.velocity.x, targetManeuver, Time.deltaTime * smoothing);
- rb.velocity = new Vector3 (newManeuver, 0.0f, currentSpeed);
- rb.position = new Vector3
- (
- Mathf.Clamp (rb.position.x, -1.88f, 2.5f), -----> -1.88 is the x value where the ball is supposed to stop, and its in fact stopping there, but this value changes, i suppose, depending on the resolution
- Mathf.Clamp (rb.position.y, -8f, 7f),
- 0.0f
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement