the action is not triggered. tell a beginner

0 favourites
  • 2 posts
From the Asset Store
A revolutionary theme studied and built for both professional & beginners
  • Всем привет. Подскажите почему не срабатывает список действия? При касании соперника меньше 150 пикселей у игрока должна отниматься hp и уровень перезапускаться. Но ничего не происходит

    Hello everyone. Can you tell me why the action list doesn't work? If the opponent touches less than 150 pixels, the player's HP must be taken away and the level restarted. But nothing happens.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Because you are not picking an enemy instance. If you have multiple enemies, without picking, the distance() expression will only check one of them.

    I suggest using Line Of Sight behavior instead - add it to Enemy sprite, set distance to 150px.

    Enemy has LineOfSight to Player : Player subtract 1 HP
    

    Also, if you have multiple enemies, disabling their event groups is not a good idea. It will obviously disable all enemies, not just one.

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