![]() |
Cyan debug line in physics scene |
Wednesday, 7 October 2015
Physics Debugging and Manual Interpolation
Following up from Monday's session, we implemented debugging to see how Unity controls the change in velocity. To do this I added a max speed which, when reached and passed, lowered the speed back below the maximum. The speed was not lowered to a constant however and continues to increase meaning this process happens very quickly multiple times a second. To show this, a line is set to be drawn that shows the direction and magnitude of force. This line appears to vibrate/shake rapidly when the player moves which is the program constantly adjusting the velocity.
Another thing I added to this weeks work was creating manual interpolation rather than have it bounce back and forth of it's own accord. To do this I only needed to tell the co-routine that it should only operate when a specific button is pressed and held. This sort of mechanic could be used for moving platforms and can even be set up to activate the interpolation upon a single button press, allowing you to make elevators.
Labels:
Development,
Interpolation,
Physics,
Unity
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment