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

Ball stucks between two walls at X axis

Discussion in 'Scripting' started by XardasLord, Mar 19, 2016.

  1. XardasLord

    XardasLord

    Joined:
    Mar 12, 2016
    Posts:
    6
    Hello everyone,

    I have a problem with bouncing ball in a game, something like Arkanoid/Breakout/Pong. My ball stucks between two walls in X axis. I attached a movie in zip file. How can I prevent it? Without code, or should I do it in code? Or change change some physics material attributes?

    Thanks
     

    Attached Files:

  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,903
    XardasLord likes this.
  3. XardasLord

    XardasLord

    Joined:
    Mar 12, 2016
    Posts:
    6
    Thanks for your reply, I will check this thread.

    Yes, I am using 2D physics. My physics material settings are here:

    But only my ball has a physic 2D material. My walls should have it too?
     

    Attached Files:

  4. XardasLord

    XardasLord

    Joined:
    Mar 12, 2016
    Posts:
    6
    Changing velocity threshold on my ball physics material doesn't help here. What am I doing wrong?
     
  5. Zaflis

    Zaflis

    Joined:
    May 26, 2014
    Posts:
    438
    Try setting ball's Friction and gravity 0.
     
    XardasLord likes this.
  6. XardasLord

    XardasLord

    Joined:
    Mar 12, 2016
    Posts:
    6
    Friction + velocity threshold did that trick, thanks :)