How to make a car that you may enter and leave.

2
  • 2 favourites

Stats

1,237 visits, 1,547 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Hello anyone reading this! Today i'm going show you how to set up a car in construct 2 that allows you to enter and exit without disrupting anything else you set you. (hopefully)

If you are still interested in my way of doing this then read below!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Alright the first thing you have to do is set up the car how you want it. Such as movements, sounds, and anything else you want so it acts more car like. You must also remember to set the state of this car as disabled.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Now that you have your car and made it the way you would like for it to act you need to create a variable. The only variable you have to create is a variable that checks if you are in the car. I personally called it "IsInCar" and I left the starting number as 0.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

One you have that variable created we need to make it check if you are in a car. It depends on how you want the player to enter the car. For a mouse over and keyboard key press entering system you will need the two functions. Go to the layout, right-click , and add the keyboard and mouse functions. After you have that done go back to the event sheet and add 3 events to one block. Keyboard:On (Your key choice) Pressed, Mouse: Cursor is over (Name of car), and System: (What you named your IsInCar variable) equal to 0. When you have done that create a action. The action will be System: Set (Your Car Variable Name) 1.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

We are almost done! The next thing you add to add is a way to get out of your car with out the still being able to move. For this you must add a event System: (Car Variable) = 1 then add a sub event. In this sub event you will add Keyboard: On (Your Key Choice From Before) Pressed and (Your Car's Name) Is overlapping (Your Player) then in the action you must add System: Set (Car variable name) to 0.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Whoops I almost forgot! You must stop your character from moving and enable the car to move. To do this add a event System: (Car Variable) = 1 then for the action add (Player): Stop (Your movement type 8D or 2D), Audio: Stop (Do this if you have foot steps), and (Car name): Set Car Enabled. With this you will be Driving the car without moving out of the away.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Now you have to make your character go with the car. To do this create a event System: (Car Variable) = 1 and System: Every Tick then for the action add (Player): Set position (Car).

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Now there is one more thing you must do. Is add a event System: (Car Variable) = 0 then add the action (Car) Set Car Disabled.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

There you are done! You can now enter and leave your car. You can add on as much as you want to the car without it effect your game. Have fun!

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!