How Do I Make Something Fly Through A Hole

Discussion in 'How Can I...?' started by chrislambeth, Aug 17, 2016.

  1. chrislambeth

    chrislambeth Boxer

    Joined:
    Aug 16, 2016
    Messages:
    5
    Likes Received:
    0
    Looking to make my character fly through a hole in a gate but still able to hit the gate. Not quite sure how to do it.

    Thanks!
     
  2. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    You need at least 2 objects, one for the back and one for the front. When you place these two exactly next to each other it looks like one. The back is placed "deeper" than the character. In other words character covers the that object when moves in front of it. Front is the opposite, so it covers the character. You can adjust Z coordinate by selecting the object or character or effect and pressing Cmd+[ and Cmd+] or Ctrl+[ and Ctrl+] depending on Mac or Win. Alternatively drag and move the object up and down on the object browser at the left hand side.

    These two objects should be set as non colliding. Then place an invisible object to the top and bottom which are colliding, so it gives you the impression that you hit the gate. You can also set these latter two as Enemy with fixed movement, so when you hit it character will be destroyed...

    An alternative to this is that there is no hidden objects but your gate is made up by 4 objects, the middle left and right are the front and back as described above, and the top and bottom are just like the hidden objects except those holds the sprites for the top and bottom of the gate...
     
    Christoph and carlosabreu1981 like this.
  3. chrislambeth

    chrislambeth Boxer

    Joined:
    Aug 16, 2016
    Messages:
    5
    Likes Received:
    0
    Great! Thank you! I figured that's what I might have to do but didn't know if there was an easier way!
     
  4. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Now that you said that there were something there, can't remember what was that. But I am positive I have seen a video explaining it, he played with collision shape and it automatically adjusted Z coordinate depending character position relative to the collision shape. I think the video was about iso type of games.

    @heathclose do you remember to such video or post here?
     
  5. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    are you thinking of this video?
    https://www.buildbox.com/forum/index.php?threads/how-to-use-group-layers-for-isometric-games.6112/
     
    trudnai likes this.
  6. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701

Share This Page