How do I check below my character.

0 favourites
  • 3 posts
From the Asset Store
2d mushroom sprite 2d game mushroom character enmy sprite game art
  • Hello I am new to Construct 2, but have used game maker before. I have searched around and to no avail found help on what I am stuck on. In the game I am creating the player has the choice to "spawn a character." Once spawned the character will drop with gravity to the floor. That's all fine. My problem is I do not know how to make the system or character check below them. For instance if their is a solid floor below them, then they can spawn and drop. If another non solid character is below them they can not. I was thinking maybe distance, but i don't know how to use it in this case.

    Also there is "air" between the instances. The character is at the top and the floor is at the bottom and another character can be anywhere in between that.

  • Just off the top of my head, you could spawn an invisible line from your character downwards and see if it intersects floor. Or you could check the specific x,y of where you want the object to spawn, and see if there is floor there.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Create an invisible line off the spawned object. It's a new sprite, invisible. It checks to collide with a floor or character. What about a small line with bullet. Think like a sonar. When you click the mouse to spawn it shoots out and if it collides with a solid then you spawn, if not no spawn. Could that work?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)