2D sprite and 3D model- swap visibility upon keystroke

Hey everyone, new user to Unity here. I’m working on a prototype for a new game where one of the main mechanics will be the player character swapping between a 2D sprite on the ground to a 3D model and vice versa upon hitting a key. Right now I have both objects moving in tandem and was wondering how I could set the visibility of the 3D model to start as false and swap between the sprite and model upon hitting a key like the spacebar.

Again, this is all fairly new to me, ESPECIALLY navigating C#, so spare no detail, I yearn to learn!

that’s very simple. Everything you can click/tick/adjust in the editor is simple to do with a script in unity. you’d just be looking for

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class renderer : MonoBehaviour
    public SpriteRenderer sprenderer;
    public MeshRenderer meshrenderer;
    public bool tickme = false;
    // Use this for initialization
    void Start () {
	// Update is called once per frame
	void Update ()
        //if blah blah blah happens
        if (tickme)
            sprenderer.enabled = false;
            meshrenderer.enabled = true;
            sprenderer.enabled = true;
            meshrenderer.enabled = false;

Awesome!! Once I assigned the items I needed it worked great! One last question, how would I make it so that hitting the space bar check/unchecks “Tickme”?