Collision advice

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By keke
:warning: Old Version Published before Godot 3 was released.

Before coming to Godot, I used the Blender Game Engine. In the BGE, you could assign objects ‘properties’ that could be used for collision detection. For example, I might assign some spikes and an enemy in a platformer game the “hurt” property. Then I could write some code in the player script that would dictate what actions should be taken when the player comes into contact with that property (become temporarily invincible/flash white, lose a heart, whatever).
Is there an equivalent system in Godot, or should I do things a different way?

Edit: To clarify: I want to write something that works somewhat like my platformer example - how should I go about doing this?

:bust_in_silhouette: Reply From: avencherus

http://docs.godotengine.org/en/stable/tutorials/2d/physics_introduction.html#triggers

In blender they were called sensors, same idea. I don’t see how this answers my question - please elaborate.

keke | 2017-01-07 07:28

:bust_in_silhouette: Reply From: eons

I don’t know how the BGE works, but I guess that what you call “contact with a property” here could be collision/overlap detection against CollisionObjects/Shapes (pretty much like Box2D), then using signals or checking collisions during process.

Look at this very simple tutorial (text), there, contact reporting (with areas) are explained but uses all the types of collision objects to make the game:
http://codetuto.com/2016/04/create-catch-egg-game-godot-engine/

If you want to skip all the project setup, the part where talk about bodies and areas is the 4th.

:bust_in_silhouette: Reply From: keke

Answering myself - what I wanted were groups. Sorry if the wording of my question was unclear!