For enabling the console you have to change the shortcut of Portal 2:
1) Create new shortcut (left click at desktop and select new shortcut).
2) Input this path as location "C:Program Files (x86)ValvePortal 2portal2.exe" -console (this path is default)
3) Write a name of shortcut .
4) Run shortcut. After this game should be run. Now console will work.
5) To exit/open the console, just use the ~ symbol in game to use these codes in game.
Note: to make some of these codes work, you need to enter this code into the console: sv_cheats 1
|host_timescale # (default=1)||Changes speed of game, 0.1 = 10% of original game speed, 2 = twice the original game speed|
|firstperson||Changes view to first person|
|thirdperson||Changes view to third person|
|ent_create_portal_companion_cube||Creates a Companion Cube|
|ent_create_portal_reflector_cube||Creates a reflector cube for lasers|
|sv_gravity # (600=normal)||Lets you change the gravity in the game|
|noclip||Lets you go through walls and fly around|
|sv_portal_placement_never_fail # (1 or 0)||Place portals anywhere|
|buddha||Player can take damage but won't die|
|ent_create_paint_bomb_portal||Shoots conversion gel out of your face|
|ent_create_paint_bomb_speed||Shoots propulsion gel out of your face|
|ent_create_paint_bomb_jump||Shoots repulsion gel out of your face|
|ent_create_paint_bomb_erase||Shoots water out of your face|
|cl_showfps 1||Shows FPS Rate|
|sv_cheats (0=off/1=on)||Turns Cheats on/off|
|notarget||Turrets won't shoot at you|