Pressing C to switch camera views

So I made a game where you can drive around in a car, but i want to make the option to switch cameras from an inside view to an outside view by pressing C on your keyboard. I have no idea how to do this though and would like some help. Thanks!

Here is the game if you are interested in helping:

Hi @TheLaidBackLama,

You can use a when key is pressed event CoBlock, and a switch camera CoBlock to make this happen. See the following video for details:

Hope this helps! Let me know if you have any further questions about this. If this solves your problem, please mark this post as the Solution.

Many thanks,
Geoff @ TechLeap

Thanks so much! I still have a problem though. When I put in a “when key is pressed” event and a “switch camera” coblock inside, if i press C It will go to the outside camera but when I press C again, it doesn’t go to the inside camera. Any idea how to fix this?

You will need to store the state of whether the outside camera is selected or not. You can do this with a set variable block, containing a boolean value (true or false). Inside your event, use an if/then/else control block to check the state, and switch cameras.

Let me know if you have further questions about this. See if you can work the code out for yourself first.

Good luck!

Geoff @ TechLeap