Hello! My name is Francesco and this is the assignment 10 - Portal!
The main title of the assignment is "Portal", but we can call it "ProBuilder" instead.
Indeed, the goal this time is to "practice" with ProBuilder and create a simple level adding the FPSController,
creating an object to end our level and display on screen "You Won!" when we achieve it.
For this assignment I didn't use the Asset Store as recommended from CS50,
and I used an older Unity version, this is cause I encountered some issue with the Distro.
So, this is my level,
is pretty much simple, nothing special, I could do it better.
We start from the house, need to go on the stairs,
jump on static platforms 'till we reach the roof, go on to the stairs again,
jump on moving platoforms and finally end our level colliding a sphere.
After using ProBuilder, I added the FPSController from the same Distro to the Hierarchy's Scene, and a Canvas to display "You Won!" as requested.
The Canvas and the script to display "You Won!" are pretty much similar to the Dreadhalls's assignment (Assignment 9).
To add a little bit of difficulty, I scripted the last platforms to move on.
To do this, I added invisible GameObjects with a Box Collider between the moving platforms in a certain distance.
After that, I created a new script for the platforms where, with a boolean control,
I translate the platform in the positive
X-Axis direction and when they collide, the platform just changes the negative X-Axis direction.
So it will keep going on in this way.
In the end, if the platform collider collides with the Player, the latter will become its children.
This is because we want the player to move on with the platform at the same time, so in this way the player will depend from the transform of its parent, so the platform.
And of course we need a TriggerExit to return our Player at its original state where we don't collide anymore with the platform,
to get back his transform and not depend from other objects.
So, let's test our Demo now.
So, this level is pretty much simple as i said...
Platforms moving...
And, we can move with them...
There's the final object.
So, if we collide with it...
"You Won!" displayed on screen.
And, if we press space...
We can restart the game.
So, this is pretty much all for this assignment and see you to the next one!
