Collision Bug?

BoinkologyBoinkology Member Posts: 7
edited November -1 in Working with GS (Mac)
Hey Guys,

I am working on a set of pathfinding behaviors for my game, and I am having some issues. I am wondering if there is a bug or if I am just misunderstanding how things work.

In the physics attribute of an object, you can set a collision group and a bool for collidable.

The Game salad wiki states:

"Collides

If one actor collides with an instance of another actor, it can send an event to the actor.

For an actor to have an event sent when it collides with another actor, the actors must share collision groups. This can be set in the Attributes of the actor, or using the Bounce behavior.

Note: An actor does not need to have the Collidable attribute set to have collision events sent to it. That attribute will only determine if the actors physically bump each other."

I have "path" actors that are set to a certain collision group, with collidable set to false. I also have another actor called "blip" in the same collision group and with collidable also set to false. In the blip actor I have an behavior that states that if "blip" collides with any or my path actors, display text that says true. Its always false.

Has anyone else had any luck getting collision events on actors in the same collision groups with collidable set to false?

Thanks,
Homero

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Hey Homero,
    Have you tried giving both the path and blip the Bounce behaviors and setting bounce to the group they are in? Its a small issue that is known that only collision group 1 is sending events in the case stated in the wiki.
  • BoinkologyBoinkology Member Posts: 7
    Ah, that makes sense. I did try using the bounce behavior, but with no success. However, I was already using the collision group 1 on other actors for my walls and actors that collide with walls. I'll switch the collision groups around and see if that works. I will also post back with my findings.

    Thanks,
    Homero
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    So here is an example of what I just created.

    1. Create 2 actors.
    2. Change the Physics attributes for both of them to Collision Group 2 and Collidable=false.
    3. Add the Bounce behavior to both actors and make sure collision group 2 is selected for both.
    4. On actor1 have it display text 'True' in blue when it collides with actor2.
    5. Give actor1 the accelerate behavior just so it can move to collide with actor2.
    6. Add both actors to the scene so they are on the same horizontal alignment.

    Things you will notice: In a microsecond, the word 'True' will appear on actor 1. Don't blink or you'll miss it. :)

    This will also work if actor1 is in Collision group 2, and actor2 is in Collision group 3. You will need to modify actor1's bounce behavior to collide with collision group 3, and actor2's bounce behavior to collide with collision group 2.

    Note: You may need to select one of the actors in the scene for the change to go through.
  • BoinkologyBoinkology Member Posts: 7
    That's interesting. So when two actors collide it sends a single event saying a collision has occurred, but if the actors are still colliding (e.g. passing through each other), it doesn't send additional events? If the colliding actors are no longer colliding, then when they collide again, a new event will be sent?

    Thanks for the explanation on the bounce behavior. It seems obvious to me now, but at the time, I didn't think about needing to put the bounce behavior on both actors.

    I'll try these solutions after work.

    Thanks,
    Homero
  • RumiRumi Member, PRO Posts: 343
    Hey look! Its the oldest working, postable thread!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Rumi said:
    Hey look! Its the oldest working, postable thread!

    And now its closed. Thanks….

    In the Future do not bump old threads. The information is generally outdated and either incorrect, incomplete, or no longer applies to the current Build of GameSalad.
This discussion has been closed.