Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

CheckPoint Respawn Doesnt Work

Discussion in 'Scripting' started by iFreshhd, Apr 12, 2021.

  1. iFreshhd

    iFreshhd

    Joined:
    Apr 12, 2021
    Posts:
    1
    Hi, I am learning 2D game development with Unity (YouTube courses) and I have a problem with the checkpoint. When I pass the map / scene, it starts from the place of the previous checkpoint and not from the starting point of that map / scene.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,517
    To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

    Doing this should help you answer these types of questions:

    - is this code even running? which parts are running? how often does it run?
    - what are the values of the variables involved? Are they initialized?

    Knowing this information will help you reason about the behavior you are seeing.

    If you are running a mobile device you can also see the console output. Google for how.