Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Karting Microgame - Smart Kart Can't See Checkpoints Over Ramps

Discussion in 'Getting Started' started by KeyLimePi3-14, May 11, 2024.

  1. KeyLimePi3-14

    KeyLimePi3-14

    Joined:
    May 2, 2024
    Posts:
    1
    I'm running Unity 2021.3.37f1, and I'm working with the karting microgame. I didn't realize the tutorials outside of the editor were written for version 2019.3 when I created the project, so that's why my version is newer than the tutorial's recommended version.

    I've done the tutorial to change the player's kart, and add a smart kart. I have the AI checkpoints working when the track is a plain loop, but as soon as I put my ramp in, the smart kart decides it's going to jump off the track in an attempt to get to the next checkpoint that it can see (the checkpoint perpendicular to the ramp's location on the other side of the track. Once it's stuck in the middle, it keeps driving around the walls of the track, trying to follow the checkpoints. I've been trying to search online and just mess around with things on my own, but I haven't figured out how to make the smart kart realize there's a checkpoint behind the ramp; I've even put checkpoints onto the ramp to attempt to guide it to no avail.

    The track layout, circuit goes counter-clockwise. Green lines are the AI checkpoints. The small pink ramps behind the big ramp are my "rescue ramps" for when I inevitably fall off the track.


    AI checkpoints and them in the correct order in the inspector the smart kart.


    Smart kart should be able to have a line of sight with the checkpoint right after the one it's at for each of the checkpoints here...


    And the smart kart going off the track as soon as it hits the ramp.


    If there's any other screenshots I can provide that'd help I'll gladly share them. I'm going to keep working on the microgame without the ramp for now, but I'd love to put it back in if I can make the smart kart handle properly over it.
     

    Attached Files:

  2. hollowaybartlett450708

    hollowaybartlett450708

    Joined:
    May 16, 2024
    Posts:
    1
    Try placing the checkpoint after the ramp closer to the ground, ensuring it's not directly visible from the starting point of the ramp. This should force the AI to follow the track to reach it.
    If your AI uses raycasting to identify checkpoints, consider temporarily disabling raycasting on the ramp section. This will prevent the AI from seeing the far checkpoint and force it to rely on the checkpoints along the track.