Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:all-features:collisions [2019/06/13 21:41]
piyushpalawat99
gdevelop5:all-features:collisions [2020/07/24 18:29] (current)
the_gem_tutorials [Detect collisions with the Physics behavior]
Line 6: Line 6:
  
 ## Make objects solids: use the "​Separate objects"​ action (good for top-down games, RPG...) ## Make objects solids: use the "​Separate objects"​ action (good for top-down games, RPG...)
 +{{:​gdevelop5:​all-features:​separate-condition.png?​|}}
  
 You can use the "​**Separate objects**"​ action to move objects manually. The "​Separate objects action can also move objects with "​forces"​ or by setting the object position. You can use the "​**Separate objects**"​ action to move objects manually. The "​Separate objects action can also move objects with "​forces"​ or by setting the object position.
Line 33: Line 34:
  
 <note tip>​**See it in action!** 🎮\\ <note tip>​**See it in action!** 🎮\\
-Open this example online: https://​editor.gdevelop-app.com?​project=example://​bomb-the-crate</​note>​+Open this example online: ​[[https://​editor.gdevelop-app.com?​project=example://​bomb-the-crate| Bomb the Crate Example]]</​note>​
  
 [[https://​editor.gdevelop-app.com?​project=example://​bomb-the-crate|{{ :​gdevelop5:​all-features:​checkccollisionbetweenobjectsnew.png?​ |}}]] [[https://​editor.gdevelop-app.com?​project=example://​bomb-the-crate|{{ :​gdevelop5:​all-features:​checkccollisionbetweenobjectsnew.png?​ |}}]]
Line 52: Line 53:
  
 <note tip>​**See it in action!** 🎮\\ <note tip>​**See it in action!** 🎮\\
-Open this example online: https://​editor.gdevelop-app.com?​project=example://​platformer</​note>​+Open this example online: ​[[https://​editor.gdevelop-app.com?​project=example://​platformer|Platformer Example]]</​note>​
  
 ## Game with physics? Use the Physics behavior ## Game with physics? Use the Physics behavior
Line 62: Line 63:
 ### Detect collisions with the Physics behavior ### Detect collisions with the Physics behavior
  
-When you're using the "Physics" behavior, ​**do not use** the "Collision" ​condition that is in the **Features for all objects** category. //The physics engine will manage all collisions by itself.// ​ The Collision condition won't properly detect when objects are touching.+When you're using the **Physics** ​behavior, //do not use// the **Collision** condition that is in the **Features for all objects** category. //The physics engine will manage all collisions by itself.// ​ The Collision condition won't properly detect when objects are touching.
  
-Instead, use the Collision condition ​**inside the Physics ​behavior category**, which properly uses the physics engine to simulate the collisions. ​+Instead, use the Collision condition ​//inside the// **Physics** ​//behavior category//, which properly uses the physics engine to simulate the collisions. ​
  
 {{ :​gdevelop5:​all-features:​usephysicsbehaviornotcollisionconditionnew.png?​ |}} {{ :​gdevelop5:​all-features:​usephysicsbehaviornotcollisionconditionnew.png?​ |}}
  
 +Additionally,​ objects with the **Physics** behavior ignore the hitboxes of the object, and instead use the collision information on the **BEHAVIORS** tab of the object itself. This defaults to a box that is the full dimensions of the object. In most cases there will be a need to change these settings from within the **BEHAVIORS** tab. 
 +{{ :​gdevelop5:​all-features:​physics_hitbox.png?​ |}}
 <note tip>​**See it in action!** 🎮\\ <note tip>​**See it in action!** 🎮\\
-Open this example online: https://​editor.gdevelop-app.com?​project=example://​physics</​note>​+Open this example online: ​[[https://​editor.gdevelop-app.com?​project=example://​physics| Physics Example]]</​note>​
  
 {{ :​gdevelop5:​behaviors:​hingeleverdemo.png?​200 |}} {{ :​gdevelop5:​behaviors:​hingeleverdemo.png?​200 |}}