Turning Invisible When Taking Damage In Certain Areas

0 favourites
  • 5 posts
From the Asset Store
Get Ready for the New Wave of "Bottom Screen" Games!
  • Hello,

    I'm having some trouble with taking damage in certain areas. I recently implemented fixed camera screens. Where instead of scrolling the camera will stay fixed in one area and then pan to the other. For some reason though, when I get hit by enemies in these fixed camera areas, my player turns invisible and doesn't take damage. When I walk back to a normal scrolling area, my character flashes like he took damage and returns to normal. I assume this has to do with my events that play out when my player takes damage. But looking over those events, I don't see how the camera would effect it.

    Here is my project file: drive.google.com/file/d/1XXxEobpweiX9qJV7W7mIyytLBJWTW4zs/view

    To simulate the problem walk into the cave and take damage. If you walk out of the cave and back to where the camera scrolls the player will become visible again.

    Thanks!

  • Your camera Moves To the same point on every tick. So on every tick both events 15 and 16 in scr_General are triggered, toggling your character's time scale between 0 and 1.

    I guess this messes up with Flash behavior and as a result, your character gets stuck in invisible state.

    You should only order your camera to move to a new position when it's different from its current position.

  • Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I fixed it by adding a condition to event 14 that makes it only activate if camerafixed.X does not equal camerafixedorigin.x. My death animation uses the time scale function to make it look like it's happening in slow motion. But now my death animation won't scale the time down. I assume this is because of event 16. For some reason camerafixed is constantly arriving. Why is that happening? Since I put in that check the camerafixed shouldn't be moving and arriving anymore.

  • Maybe there is another event that moves the camera?

    Try debugging - add Browser object and "Browser Log" actions to your events, then when previewing the game press F12 and open console tab. You will be able to see in the console which events are triggered and when.

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