About 104,000 results
Open links in new tab
  1. unity - How to detect collision occurring on a child object, from a ...

    Dec 3, 2017 · Direct quote from Unity Answers (written by Ashish Dwivedi): Add a script to child and inside it have a reference of script of parent object. Now write 3 methods in parent script …

  2. Unity: OnCollisionEnter not called - Game Development Stack …

    I created a sphere object, added a rigidbody component (no kinematics) and attached a script to it like this: function Update () { } function OnCollisionEnter(collision : Collision) { Debug...

  3. How to do collision detection in Unity between Character …

    Jun 10, 2020 · 1 I would like to know more about how collision detection works in Unity especially when character controllers and NavmeshAgents get involved. For example, how can I detect …

  4. unity - Why the OnCollisionEnter is not working? - Game …

    Mar 28, 2020 · { private void OnCollisionEnter(Collision collision) { Debug.Log(collision.transform.name); } } But when the player is moving and hit the cube it's …

  5. unity - How do I trigger a collider on a child game object from the ...

    May 15, 2017 · I have demonstrated this, below, using a basic script that prints to the debug log through a single OnCollisionEnter method. As you can see, the parent contains the script, …

  6. unity - Unity3D Get collision without having Rigidbody - Game ...

    Jul 15, 2015 · In the script I have the method OnCollisionEnter(Collision other) where I want to check if the collided object is the same as a pre-defined variable, but when they collide, …

  7. How to set only one collider with OnCollisionEnter(Collision col) in …

    May 30, 2016 · For example, consider this game object hierarchy in Unity: Ship (Empty parent) Bridge (Capsule collider and BridgeSystem script) Hull (Box collider and HullSystem script) …

  8. unity - Is there performance difference between OnCollisionEnter …

    Mar 20, 2019 · Is there performance difference between OnCollisionEnter and OnTriggerEnter? I have around 12 objects all calling OnCollisionEnter when in fact OnTriggerEnter could work as …

  9. unity - OnCollisionEnter2D not working - Game Development …

    Jul 16, 2020 · Is IsTrigger enabled on the Floor? Because if it is OnCollisionEnter doesn't get called, but OnTriggerEnter instead.

  10. unity - Why isn't OnCollisionEnter being called? - Game …

    Jan 15, 2020 · I put this line Debug.Log("Collided with" + collision.gameObject.name); to debug whether the function OnCollisionEnter (Collision collision), was being called. On my hammer, …