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

Questions Regarding the Roll A Ball Game given in unity website tutorial

Discussion in 'Scripting' started by mimoban, May 27, 2015.

  1. mimoban

    mimoban

    Joined:
    May 27, 2015
    Posts:
    2
    the project tutorial is in the following url
    http://unity3d.com/learn/tutorials/projects/roll-a-ball

    I am very new to the unity environment
    If you have already gone through this Can you please answer my question?

    I am seeing if i check the "Is Trigger" in sphere collider component of the main player then it is free falling down the board. Is it because If "Is Trigger" is enabled, the Collider is used for triggering events, and is ignored by the physics engine? I want to check the "Is Trigger" to detect some collision but i dont want the ball to free fall from the board. How may i solve the problem? Kindly help me.
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    "Is Trigger" means that, when something collides with it, neither object will "bounce" or be altered by the physics engine - it will only send your script OnTriggerEnter/Stay/Exit events, nothing else. Non-trigger colliders both send events (in this case, OnCollisionEnter/Stay/Exit), and affect physics.
     
  3. mimoban

    mimoban

    Joined:
    May 27, 2015
    Posts:
    2
    Then What is the solution around so that i can detect a collision between two rigid bodies and also it won't be ignored by the physics engine? Earlier i had OnTriggerEnter function in my script? Should it be changed to something else?
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,773
    OnCollisionEnter will detect a collision between two non-trigger colliders.