Difference between revisions of "How To Make Your Objects Collidable"

(Added other items)
(Alternate Geometry)
Line 28: Line 28:
 
* [[Taking_A_Beach_Ball_With_You#Adding_colliders | Adding Colliders]]
 
* [[Taking_A_Beach_Ball_With_You#Adding_colliders | Adding Colliders]]
  
For mobile objects,
+
For mobile/kickable objects, you must first create the collider version of your object as a separate object, as described in the "Adding Colliders" tutorial above.  Then you have two ways to proceed:
 +
 
 +
1. Add a new String property in the Logic tab with name set to "collider-for" and the value set to the name of the visible object, for which this is the collider.
 +
 
 +
2. Alternatively, toggle on the Actor button for the collider object and set it to Dynamic, then transfer over the mass, friction and elasticity settings from the kickable object.  Then set its parent on the '''Object''' tab (F7) to the name of the visible object.  Finally, on the visible object's '''Logic''' tab, set it to Static and toggle off the Bounds setting (now that the child object has all this information).

Revision as of 14:01, 29 June 2009

This article describes the various ways to turn your visible objects in your age into solid objects into which your avatar (and other solid objects) can collide.

Basic

To make your visible object 'collidable' (i.e. have your avatar stop when running into it) is to press the Bounds toggle button on the Logic tab:

BoundsButton.jpg

You can then specify the shape of the collider for your object. Using the pulldown menu next to the Bounds button, choose one of the following:

  • Box: Places a bounding box around your object
  • Sphere: Places a bounding sphere around your object
  • Convex Hull: Calculates the Convex Hull for your object
  • Triangle Mesh: Uses each triangle from your visible object as a collision triangle
Note: Cone and Cylinder are currently not supported.

Kickables

If you'd like to make your object mobile - meaning that you can run into it, and it moves - see the following tutorial:

Alternate Geometry

If you have a complex object (e.g. composed of many polygons) and none of the above types produces the kind of solid 'shape' you're looking for, you can produce your own collider. For static (non-moving) objects, see the following tutorial:

For mobile/kickable objects, you must first create the collider version of your object as a separate object, as described in the "Adding Colliders" tutorial above. Then you have two ways to proceed:

1. Add a new String property in the Logic tab with name set to "collider-for" and the value set to the name of the visible object, for which this is the collider.

2. Alternatively, toggle on the Actor button for the collider object and set it to Dynamic, then transfer over the mass, friction and elasticity settings from the kickable object. Then set its parent on the Object tab (F7) to the name of the visible object. Finally, on the visible object's Logic tab, set it to Static and toggle off the Bounds setting (now that the child object has all this information).