How do I fix my walking enemy?

0 favourites
  • 2 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • Hi all! I'm brand new to scripting, and I'm working on this for a project. It's due in a little bit, so I'm sure I won't be able to get the help I need for this enemy, but I still want to know what I'm doing wrong.

    I have an enemy ogre that has a short path it walks. I've scripted it to follow the player when it is within LOS. The ogre is extremely buggy. It only animates properly when I go to the right; it slides to the left but is frozen in the first frame of its animation. It also does not stop to play the "hit" animation when it is hit with the bullet from the player. Because of this, the ogre cannot die. It will also occasionally either blip into the floor or walls, fall through it, or even push the player character through the floor or walls. I've watched the tutorial videos I have from my classes and tried to do a few things myself but I can't figure out how to fix it.

    I'm not sure how to show you all my work so far, so if someone could help me do that too, I'd be grateful. Like I said, I'm extremely new, so I'm sorry!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is a common issue where multiple animations are trying to play at once. You have to use conditions that make sense to ensure that none are played at the same time. For example here you are trying to play 'attack' and 'walk' at the same time, so you have to add a condition on the 'walk' event such as 'attack animation is not playing', this allows attack to play and then return to walk once finished instead of trying to play walk anim at the same time.

    edit : I misread the animation it's 'hit' when an enemy gets hit by something but the same logic applies, you add to the walk animation event a condition like 'hit is not playing'. Also the ogre should die because receiving damage should be separate from the animations, such as 'bullet on collision with ogre then take damage' rather than on hit animation played.

    For falling through the floors and strange bugs around that, take a look at the collision box of the ogre in the image editor, make sure it's a box and not a random shape based on the image.

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