Line of sight flickering issue...

0 favourites
  • 14 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hey all, hopefully this is an easy fix but it's driving me crazy. I'm working on more complete enemy AI where the enemy follows the player when within the line of sight. Below is an abbreviated screenshot of where I am starting, but on the run animation the enemy flickers back and forth between 'run' and 'idle'. In the debug layout it is also showing that when line of sight is active the state is flickering back and forth, so I know it isn't any sort of issue with animations. I have referenced a handful of tutorials but this doesn't seem to be happening for them as I follow along. Thanks for the help in advance!

  • Likely nothing to do with that event. You probably have another event somewhere that tells the enemy to set animation to idle and that's interfering with run.

  • Thanks for the reply , that can't be the case though. This is the first enemy I am setting up and the snippet I pasted is the only event I have implemented for enemies at the moment. Everything works fine until I add the 'does not have line of sight' condition, then it begins flickering on 'run'.

  • Try a For each above the Line of sight event, and use Else instead on the inverted LOS.

  • blackhornet thanks for the suggestion, below is the updated event, though the same flickering is happening in the run animation :/ I've also tried this on a fresh project with the same results.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do realise line of sight can happen every tick?

  • newt thanks but I'm not sure I understand what you are suggesting. The issue is that the animation is flashing between run and idle with both of the examples above, not starting over every tick. What is your suggestion for fixing this issue?

  • You're telling it to run either this animation, or that animation, every tick.

  • Every tick is not ideal but it shouldn't really be causing this issue, it's strange. add a trigger once to LOS event, move the simulate actions out into their own events and see if it fixes the issue.

  • Thanks , I couldn't get that to work either :/ Is there any in-depth documentation for Construct behaviors living anywhere? I can't help but to think either i'm missing the point of how to use line of sight, or there are issues with implementing the behavior in Construct 3.

  • There is a manual for all the behaviours under Learn tab at the top. The best way would be to share your basic C3 file and let someone debug the problem if you said this was happening in a new project.

  • , I really do appreciate all the help :) I did go through the LOS documentation in that manual, I was just curious if there was a more in-depth wiki. Here is a link to the basic C3 file for anyone that wants to give it a shot -> https://drive.google.com/file/d/1-886aJfW8agGCES3PPQKibmWElprUeB6/view?usp=sharing

  • The issue is with the collision box of the robot. Bring it the bottom of the robot image on the run animation and then apply to the whole animation. At the moment the collision box is kind of floating around there.

  • , ah! Thanks again for all the help. Super dumb mistake ... but a great learning experience :)

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