Teleport

0 favourites
  • 5 posts
From the Asset Store
A pack of shamanic magic spells for Viking shamans, ancient tribal sorcerers, warlocks and witches, containing 240 SFXs.
  • My intention is to teleport my character 50 pixels to the right when you press a button. But then, I do not want to be stuck in a wall package. How I can detect if the character collide?

    Thank you very much for the help :)

    PS: Sorry my English.

  • There should be a function to execute as follows:

    If object collides with wall on pressing "right" move object for 1 px to the left. Loop that event and you should just stand in front of the wall.

  • Unsure exactly what your needs are,but a couple of thoughts come to mind...

    You could disable collision detection when the teleport is active re activating it when it is clear of obstruction..

    Or have an invisable sprite generated 50 pixels away...that detects a "clear space" and only allows it when clear...

  • Thanks for the reply.

    Like you I thought the ghost sprite. The problem is not how to detect whether or not that is colliding ghost.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Combining what the others said, you could turn off the sprite's collision, move to the right, then if the sprite is Overlapping a wall you move to the left each tick 'till it is no longer overlapping and re-enable collision.

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