In Ants lesson on Monday we were given the task to have a prepared bouncing ball (with a twist) ready to enter into an arena he built with everyone else’s balls.
I struggled a bit to come up with an idea and my unity at home had errors which didn’t show up at college, so I could bounce the ball, but couldn’t test any effects before the time we had in lesson to complete it.
The start function of my script for the ball was what got the ball to actually bounce on the platform, which is what Ant supplied to start us off. The ball needed a Rigidbody to have a mass and gravity, and to be able to collide with the plane, with force of 200 in the Y axis.
The Update function of my code holds the effect I added to my ball to make it different from the others. I originally intended to have my ball spin around constantly on the spot so it looked normal, so when it landed it would bounce in other directions because of it spinning as it hit the ground. I tried to find code for this and found a simple programme for the rotation of a ball.
When I used the code the ball would fly off the screen quickly to the side. Turns out this was the ball orbiting the centre point horizontally with a large radius. I changed around the settings to get the transform and rotate settings I now have in my code, so the ball would fly in small circles vertically with a translate of only 1 (as the original was 50) in X. This made the ball fly in circles rather than spin, which I actually preferred.
I didn’t have clear intentions with the ball bounce so I just kept trying things until I got something I liked. When Ant made the arena with all of the balls it was fun to see how they all interacted and the ideas everyone came up with; like size change, colour change, explosions and other original ideas. There was even a perspective camera so you could see from everyone’s balls’ point of view at different times during each round.