Create Collision

Description

The Create Collision behavior will create a new collision body for the selected object. This collision body can take the shape of a circle, rectangle, or a polygon.

 

Properties

Triggers Immediately

Object A

By default this is the current object selected. You can change this to any other object in your scene.

Circle

Set the x and y position of the center relative to the object as well as the radius for the circular collision body.

Rectangle

Set the x and y position of the center relative to the object as well as the width and height for the rectangular collision body.

Polygon

Create a polygon by defining points using an array of coordinates. [[x,y],[x,y],...]

The x and y values must be numeric for a valid polygon collision body to be created.

 

Outputs

This behavior has no outputs.

 

Examples

If an object's changes shape in game from a circle to a square you can use the create collision behaviour to ensure the collision body shape matches the graphic shape.

 

Related

Collided 

Stopped Colliding

While Colliding 

0 Comments

Article is closed for comments.