Search Unity

Endless Car Chase Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Apr 13, 2018.

  1. pasta5841

    pasta5841

    Joined:
    Apr 27, 2018
    Posts:
    6
    Thanks!
    After updating two scripts, I added terrain's Ground layer option and it works fine.
    This is a really cool template.
    I'll let you know if I find a bug.

    * Did I erase the question? I can not see my question.
     
    puppeteer likes this.
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Ok great!

    btw guys, you can check the terrain alignment behavior in the same demo scene, Just turn on the "Terrain" object and turn off the regular "Floor" object.

    TerrainObject.png
     
    siddharth3322 likes this.
  3. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    y iamg etting this error
     

    Attached Files:

  4. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Look in your ECCShop component, you probably added an empty item, without putting a car in it. Select your shop menu and check if you have a car assigned to each element in the shop.

    ECCShop.png
     
  5. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    i fixed it by reloading the asset
     
  6. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    how do i change the BG of the shop menu

    even if i add any pamel or image, it is nt showing in the shop menu
     
  7. pasta5841

    pasta5841

    Joined:
    Apr 27, 2018
    Posts:
    6
    how to get a score when Enemy cars Collide and Die
    How can it be implemented?
     
  8. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    there is serious bug in this

    i created two scenes, with all the elements which u gave in the deom scene

    the canvas shop is same for both of , just like two levels

    when in first level, after i just slelect the unlocked car
    and go to the another level, the car in the secong level is automayically unlocked
     
  9. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You used the same shop in both scenes, and you unlocked the same car in the shop in the first scene, so it is unlocked when you open the same shop in the second scene. Where is the bug?


    You can add to the player score using the function ChangeScore(int) in the gamecontroller script. So for a bonus when two enemy car die, we can call the ChangeScore function from the Die() function of the enemy car, like this:

    ECCChangeScore.png

    Here is the code that does that:

    Code (CSharp):
    1.             // If this is an enemy car, add bonus to the player
    2.             if (gameController.playerObject != this) gameController.ChangeScore(5);
    3.  
     
  10. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
     
    puppeteer likes this.
  11. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Which version of ECC are you using?
     
  12. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    the latest version, which has terrain in it
     
    puppeteer likes this.
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Found it, thanks.

    This was a bug in version 1.0, which I had solved earlier, but apparently returned with the latest submitted update. I'll submit a hotfix which should take a couple of days to pass review, but in the meantime you can fix it by moving this line of code like the screenshot below:



    The bug itself is that when you choose a car you can't afford, then go back to the game and restart it, then start immediately without entering the shop, you'll get to play that locked car. This fix ensures we can only play cars that we have unlocked in any case.
     
  14. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    y i get like thi error

    i just added a new car model which i made, and then i updated the canvas shop

    when i opne the store either i get the black screen or the cars will be lilted as shown in the picture

    some times it will happen and some times it automaticallly goes
     

    Attached Files:

    puppeteer likes this.
  15. Sidhanth783

    Sidhanth783

    Joined:
    May 24, 2017
    Posts:
    19
    hw to use the terrain feature ??
    i just disabled the floor and anebled the terrain, but when i do this, the camera dont follow the terrain, when the terrain ends, the games works weird

    can you plz explain how do i use terrain
     
    puppeteer likes this.
  16. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Here it depends on the animation of the object in the shop. Take a look at your animation window and see where the car object is positioned in the animation to make sure it is not inside the ground for example. Also compare it to the car in the gameplay to make sure that it is on the ground and not inside it.


    The camera should only follow the player. When using the flat floor we do a trick of the texture to make it repeat itself infinitely based on the player position, but when we use a terrain object we can't do this because the terrain is a single object. They are two different methods, there is no infinite land when using a terrain mesh.
     
  17. mediavidea

    mediavidea

    Joined:
    Apr 28, 2018
    Posts:
    2
    Hi ,
    • How do I change the terrain so it can make the cars move along uneven terrain Because the floor appears flat even after the update?
    • How can I add more obstacles?
    • Also, You were going to add dust trail, when can we expect it?
     
    puppeteer likes this.
  18. pasta5841

    pasta5841

    Joined:
    Apr 27, 2018
    Posts:
    6
    Hi puppeteer~
    I would like to add a joystick option.
    Which part of the gamecontroller should be modified?
     
    puppeteer likes this.
  19. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The game automatically works on keyboard or gamepad or touch, no need to modify anything, just connect your gamepad to test it. Here's a vid:

     
    siddharth3322 likes this.
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    For terrain, check out the answer here:
    https://forum.unity.com/threads/endless-car-chase-game-template.526688/page-2#post-3534042

    You can add more obstacles ( or items, or cars ) in the GameController object in the "ECCSpawnAroundObject" component, like the screenshot:

    ECCSpawnAroundObject.png
    Dust trails are in the latest update, and you can see a process video about them here:

     
  21. pasta5841

    pasta5841

    Joined:
    Apr 27, 2018
    Posts:
    6
    Thanks for the video!
    But My question is about Virtual joystick in mobile control. ^^;
    I want the way I want to put the Virtual Joystick(Left) and put the used item(Right)
    remove the current two-hand option.
     
  22. bopperben

    bopperben

    Joined:
    Jun 28, 2018
    Posts:
    1
    Is it possible to change the car controls so you can move the car in a tap to move and follow touch movement pattern? Like the same way as characters are moved in animal crossing pocket camp
     
    puppeteer likes this.
  23. uzumaki258

    uzumaki258

    Joined:
    May 29, 2017
    Posts:
    4
    I want to change collision of car in this game. I mean I want make this real , when car collide with wall or another car , car will reduce speed and pull back little bit. Is it possible ?
     
    siddharth3322 and puppeteer like this.
  24. aanov

    aanov

    Joined:
    Aug 22, 2017
    Posts:
    4
    Halo, i like this asset and hopes you always improve this.
    I have question about terrain, how to make this activate? i check game controller but can not found the option. Please give me tutorial . thanks
     
    puppeteer likes this.
  25. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I think it can be done with some code modification, contact me through mail and we can try something.
     
  26. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    In this type of control you press and hold, then when for example you move to the right of the initial press point the car goes right, and if you go down from that spot the car goes down? Or is it like a steering wheel?
     
  27. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
  28. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    What about a way to add enemies that you can run over and have to avoid and maybe some can jump on your car and hang on to add another enemy gameplay type to this. Also doesn't have to be cars only what about other types of things to ride or be in like say your in an orb ball, space ship or even on water on a jetski jumping on ramps avoiding sharks. This plugin could lead to all sorts of cool gameplay type stuff if you set it up for us artists to take control once its all working like that.
     
    puppeteer likes this.
  29. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    132
    Hi @puppeteer, looks cool!

    I just bought it and I'm going to start playing with it right now. After finishing the on rails shooter it's time to make something different. Go go go!
     
    puppeteer likes this.
  30. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You're talking ( in the first part of the paragraph ) about the template I will release close to Halloween time ;)

    Currently the template can be reskinned into a ship in water, or a space ship in space too though. It's just replacing the graphics mostly. Though I did once make a warships template similar to that where you had AI pirate ships shooting at you, and you could shoot back.

    It can also be reskinned into a space game similar to something else I made, called Space Ace:
     
  31. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Nice! What are you planning to make with it?
     
  32. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    132
    I have a few ideas but I'm not sure yet. For now I'm adding some extra functionality and changing the UI and stuff.
     
    puppeteer likes this.
  33. staticbl

    staticbl

    Joined:
    Jul 1, 2016
    Posts:
    12
    Hi there !

    I just purchased this and it's really well done ! Good job on the controls and feeling :)

    I'm wondering if there's an easy way for me to add actual collisions between cars. I mean I'd like to be able to crash into an opponent car (or other obstacles like walls) and be pushed back / push the other object or object further away, like in a real car crash.

    I noticed the rigidbody on cars is set to kinematic, so I tried to disable this to get the normal collisions working, but then the car moves all over the place. Do you know a way I could get collisions working and still use your controls ?

    Thanks !
     
    puppeteer likes this.
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'm reposting the answer I sent to your mail here:

    The problem with Rigibody physics in this package is that the code at its core uses the Transform and Raycast to control the car, with no use of the Rigidbody component at all. I had tried with another client before, but the result is less than optimal. So switching it to a physics based game you'll need to give up all the current behavior like the fake-drifting.
     
    Last edited: Aug 5, 2018
    siddharth3322 likes this.
  35. Konnect

    Konnect

    Joined:
    Aug 13, 2018
    Posts:
    5
    Hey there,
    ECC template is simply amazing. Am just facing a minor problem while adding new cars(by following your adding new car video tutorial), its scaled out while game start for couple of secs and then settled down on his exact position. Please help me to fix this issue.
    Thanks in advance :)
    ezgif.com-optimize.gif ezgif.com-optimize gameplay.gif
     
    puppeteer likes this.
  36. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    This is most likely an animation issue, since the Spawn clip affects the scale of the player object:

    upload_2018-8-13_13-11-3.png

    Try to edit the Spawn animation so that it scales to the final player scale you are using. My default is 1 scale but in your case it could be different based on the scale you set.
     
    siddharth3322 likes this.
  37. Konnect

    Konnect

    Joined:
    Aug 13, 2018
    Posts:
    5
    Thanks, got your point ;)
     
  38. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    How do I unasign the floor from GameController.
    sorry im a noob.

    EDIT: worked it all good.

    awesome work to mate...
     
    Last edited: Aug 19, 2018
    puppeteer likes this.
  39. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    Ok, Question
    How can I make the Camera stay behind the car, so it follows it as it turns. So its always the back view of the car..
    I really am a noob!! sorry.
     
    mediavidea and puppeteer like this.
  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I have a hidden code that does exactly that. You can turn it on by changing the variable from internal to public.

    upload_2018-8-20_3-7-45.png

    I hid it because it doesn't always behave correctly, but it should give you the camera chase rotation you need.
     
    mediavidea likes this.
  41. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    Awesome,thanks for that ill give it a go..
     
  42. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    ignore, found the problem,
     
    Last edited: Aug 25, 2018
    puppeteer likes this.
  43. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    First thing that comes to mind is shadows disabled on android quality level, but you say the quality setting is correct on mobile too.

    Could be something related to shadow bias from the light or one of the local settings?

    upload_2018-8-25_15-59-53.png
     
  44. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    thanks for that, but the problem was that I moved the camera further out from the scene, and didn't change the light view, so once increasing the directional light view it then worked fine,
    thanks.
     
    puppeteer likes this.
  45. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    Could you make a tutorial on adding more scenes and using the ECCLoadLevel from top menu? Please!!!
     
    puppeteer likes this.
  46. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Check out this quick vid:



    Here I duplicate the current scene ( Ctrl + D ), then add it to the Build List, then create a button with LoadLevel to connect between the two. It's not a clean approach but it works.

    In a better design you would have a menu scene that is dedicated to selecting all the levels you want to load, instead of putting the button in the menu of the current scene.
     
    mediavidea and adrog6666 like this.
  47. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    Dam your quick..
    thanks a lot for that, thats perfect...
     
  48. adrog6666

    adrog6666

    Joined:
    Aug 10, 2018
    Posts:
    39
    how did you get the car to go over the object, im trying, but its just going through it?
     
    puppeteer likes this.
  49. Ubroly

    Ubroly

    Joined:
    Jun 3, 2017
    Posts:
    2
    Hello Friend

    I'm really enjoying the asset :)

    I have a bug

    When I change the Floor to Terrain, the back of my cars are slightly inclined upwards.

    Could you please help me?

    Thanks

     
    puppeteer likes this.
  50. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Did you assign the relevant layer to all ground pieces you want to go over?

    upload_2018-9-4_3-30-12.png

    In the case above our layer in the GameController is "Ground", so all the objects i want the car to go over are also set to the "Ground" layer.
     
    mediavidea and adrog6666 like this.