Destroying actors from one side of another actor

skipniceskipnice Member, PRO Posts: 68

just like the title, i was wondering if someone knew how to destroy an actor from ONLY the right side of the actor, if it is not hit by the right side but the top,bottom or left the actor must live lol. thanks in advanced

Comments

  • colandercolander Member Posts: 1,610

    Use both actors x and y positions in a rule with game level attributes to determine their positions when they collide.

  • skipniceskipnice Member, PRO Posts: 68

    im sorry i dont know what you mean :(.

  • colandercolander Member Posts: 1,610

    For the basics you will need to go to the Cookbook https://help.gamesalad.com/hc/en-us/categories/200134158/ and do some study. Spend some time doing this now it will save you the pain of redoing stuff as you find out you did it the wrong way and it will speed up your development.

    Other links and of corse read the forums regularly;
    http://www.youtube.com/user/GameSaladCookbook#p/u/0/A_99wDneVeg

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    Assuming a lot of things (you provide on very minimal information in your post) like the actor that is hit doesn't rotate, that it is square and so on . . . .

    When the collision happens check the angle between the incoming actor and the main actor, if the angle is between -45 and 45 degrees then the incoming actor has hit the right hand side.

  • skipniceskipnice Member, PRO Posts: 68

    the actorBUG is moving in the direction 0. actor BLOCK's X position is constrained to the mouse(its a portrait landscape).both actors are square. because actor BLOCK moves left and right, actor BLOCK can destroy actor BUG after actor BUG has passed by actor BLOCK. i need actor BUG to survive a hit from the left or right side of actor BLOCK.

    actor BLOCK is 44x44.

    how do i tell it to only destroy actorBUG after colliding with actorBLOCKs lowest coordinates. i beleive anywhere between x-22 and x 22 at y-22.

    hope thats enough detail :)

  • nickname5862nickname5862 Member Posts: 51

    First: You say: "it is a portrait landscape". It is a portrait, or a landscape.
    Second: How can BUG possibly get hit, if he is moving to the right and BLOCK can only be moved in the mouse.x position?
    I will leave a link. Tell me everything that is not right...
    https://www.dropbox.com/sh/iwrzazdeeedtxxo/AAD2Jju-MxwjPYx5CC0sYLf2a?dl=0
    The name is: Colliding [Top]

Sign In or Register to comment.