Side Collisions

I need to be able to detect when my hero is colliding with the side of an image to disable jump (just change grounded to false), and I need to be able to also disable jump (grounded changed to false) when my hero is colliding with the top of one actor and the side of another at the same time. I tried it but it's trial and error. The side and top collision cancelling jump is working; I just want to make sure I'm doing it right. Also, colliding with the side and disabling jump is not working. This may have to do with that when I collide I enable jump. I put actors into different tags to see if it was because it was the same collision (one rule said to enable jump when colliding with actor, other said not to when colliding with side) but that did not work. Thanks in advance and any further information needed to better troubleshoot the problem will be given if needed.

Comments

  • ElfizmElfizm Member Posts: 489
    Sorry but can you just say what you need in a simple sentence because I didn't quite get what you wanting help with? Thanks
  • JakeMorJakeMor Member, PRO Posts: 136
    @creativejuicesentertainment that is a pretty convoluted post. I'm with @elfizm on this one - maybe try cutting that down to a concise and logical sentence or two, so we can help you out?
  • sparkaniasparkania Member, PRO Posts: 300
    Ok. If I am understanding you right, you want different actions to occur depending on which side of the actor is hit.

    If that is your question, what you need to do is constrain smaller actors to the main actor. and then assign collision actions to those smaller actors which will effect the main actor.
  • ElfizmElfizm Member Posts: 489
    @sparkania

    Or you could just constrain the position of the enemey and have rules,

    If enemy x position is more/less then self. Position x

    Do whatever

    Same goes for y.

    But if there is more then one enemey it might be few extra lines if code involved.
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You might find this useful. It's written to detect a jump on an actors head/top but it could easily be reworked to detect right side vs left side as well.

    http://www.jamie-cross.net/?p=607
  • I need to cancel the ability to jump when my actor collides with the side of another actor, and the side and top of 2 different actors. And k I'll try everything later. Thanks
Sign In or Register to comment.