Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Boundries of player

Discussion in 'Scripting' started by Lightme, Sep 21, 2020.

  1. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    How to prevent player for walking out of objects or terrain?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Use colliders to physically prevent the motion, or trigger colliders to reactively move the player back into bounds when detected out of bounds.
     
    Lightme likes this.
  3. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    With colliders u can prevent from keep falling off objects and fall forever.... and beyond... ?
     
  4. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    Yes.
     
    PraetorBlue likes this.
  5. Lightme

    Lightme

    Joined:
    Jul 15, 2017
    Posts:
    23
    Yuhu, thank you so much. With box colliders of the object plane I could set the boundaries that is not falling of any longer!