How do I make a car appear in game?

0 favourites
  • 3 posts
From the Asset Store
Template for a police car chase game, fully documented in comments and video
  • Hi

    I'm making a car game and I would like to know how to make that when you click a button to chose a car It makes that car the preset and appear in game and the other car disappears I don't know if I make my self very clear is that English is not my first language.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Upon selecting a car, set a global variable to a value that represents the selected car.

    When starting the game, spawn the correct car for the player by referencing what is stored in the global variable.

  • as oosyrag said, use a global variable, but instead of multiple sprites, id use animation frames, but same object for example you can have 1 sprite called CAR and inside the CAR object you can have a animation with N = infinity number of Frames.. each frame can be a CAR. or a BodyKit for the car, since you might want the Wheels to be animated independent, or use physics to rotate them. Make sure you turn the animation speed to 0 and the Loop of animation is "unchecked"

    then what you have to do to swap the frames/CAR is when you click the button you set the global variable to 5 for example, and then set the action for the CAR as follows

    Button on clicked = Set Global Variable = 5;
    		 = CAR Set animation frame to Global Variable

    And that is it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)