Get Collisions

  • One thing I noticed is that we don't have the ability to get collisions or colliding bodies. It'd be nice if we could get the attributes of an object upon collision or any other type of interaction.

    Is box "A" colliding with the ground? With an enemy? I know we have tags but not many behaviors with tags currently.

    Edit: I was able to simulate it below.

  • Admin

    Why wouldn't tags work here? I'm not sure what you mean by many behaviours don't have tags.
    Any behaviour that can affect an object, should be able to be substituted with a tag.

    If you want to check against multiple collision types, why not have multiple collided behaviours?
    One "Collided" for enemy, one collided for ground, etc.

  • If you're trying to make something like when the player colides with the ground something happenes but if it stops colliding it deacivates I know that if you stop colidind with even one of the ground tiles it deactivates. The thing to solve that could be use a empty object with the tag and strect it along the ground tiles. If this isn't the answer then I'm soryy for wasting your time.

  • I was looking to check variable collisions. I was able to get the effect I wanted though, using tags and attributes. Any object that my object is aware of should have a unique attribute.

  • @TutorialDoctor i still don't get atributes:/

  • @DGames135 The way I would explain attributes is:

    Say you have an object/character and he has different properties:

    Name: "Joe"
    Age: "24"
    Height : 6

    Perhaps one objects's name is Joe and another object's name is Sarah. You could add both the Joe and Sarah objects to a tag labeled "Human" (tags I will equate to classes in regular programming and attributes to properties). Now you can do something like this:

    if A collides with "Human" get the attribute (name) of that collision.


    If A collides with (name) then....

Log in to reply