Collision detection issue

keekee312keekee312 Member Posts: 91
edited November -1 in Working with GS (Mac)
Hi, I have 2 invisible actor (both side of the main character) which check if touch is inside himself and follow the main character. If ok, I spawn a tongue actor from the character to where I touch (thanks to magnitude demo). Since yesterday, I tought everything was ok.

In fact, Everything works fine for the first invisible actor on the left side, I can touch anywhere in the area, the tongue is spawn but in the area 2 (right side) It doesn't spawn the tongue everywhere in the area I touch, but only some points.
Thanks for help or if I can send my project to a mod, it would be great.

Cheers :)

Comments

  • keekee312keekee312 Member Posts: 91
    Thanks for help...

    Finally, because the first invisible actor works (left side) I deleted the second one and made the first one bigger. But I don't want the tongue to spit out when it's right above the character so I made a rule : when game.mouse.postionX ≠ gameplayerX+{1,2...10} => spit the tongue
    but it doesn't work, the game shuts down, why ?

    Maybe because the tongue is spawn from the PlayerX position ? So I can I make it work please
  • RattleheadRattlehead Member Posts: 485
    By shutting down, do you mean that it locks up? If so, there is a chance that your expression in the rule is malformed; there is something wrong in there and it can't complete the calculation properly.

    Second, are the actors that flank each side of your character actor of the same type? If so, is there any code inside those invisible objects that determine direction?
  • keekee312keekee312 Member Posts: 91
    Yes it locks up but I don't know what is wrong because I set the rules like this :

    ALL :
    When touch is pressed
    when TargetX ≠ gameplayerX+{1,2,3,4,5} (actually, Target X is mouse.positionX and PlayerX is character X position)
    => Then spawn tongue

    game.mouse.postionX ≠ gameplayerX+{1,2,3,4,5} means when mouse position X isn't at the same player position X+1 or player pos X+2 or player pos X+3, right ? so I don't know what's wrong ^^ because when I click/touch somewhere on the screen it should spawn the tongue (except PlayerX +1 or +2 position etc) but it does nothing and locks up after 2sec.

    And about the invisible actor, it's not the same as Player (I left only one invisible actor which is bigger than both invisible actors before)

    If you need a picture or something else, tell me :) Thanks
  • RattleheadRattlehead Member Posts: 485
    Does it lock up if you don't try spawning the tongue (touch the screen) right away when testing?

    What happens if you remove the logic? Does it still freeze?
  • keekee312keekee312 Member Posts: 91
    I believe it used to freeze when I touched the screen or not (without spawning the tongue because it can't) but now when I touch the screen, it does nothing but when I want to go back to the project, it locks up...

    When I remove the logic (mouse position ≠ ..etc) it works great (I can spawn the tongue anywhere in the invisible area/actor but this is not what I want) so it may be a logic issue..
  • keekee312keekee312 Member Posts: 91
    New try :

    Now I try to have an invisible actor put above the character (following him also), let's call it CollisionCheck (CC). Its aim is to prevent the tongue spawning.
    So, when touch is inside => change TongueOK to false
    otherwise when touch is outside : change TongueOK to true.

    Then in my Big invisible actor which is the area where the tongue can spawn itself, I set these rules :
    When touch is pressed (or inside as you want)
    When TongueOK is true
    => spawn tongue...

    Still doesn't work. I tried to play with layers but doesn't work, I always have an other issue.

    Thanks for help
  • keekee312keekee312 Member Posts: 91
    Up, anyone ??
  • keekee312keekee312 Member Posts: 91
    Help please....
Sign In or Register to comment.