How do I stop a bullet from re-appearing on screen?

0 favourites
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hello. Newbie here. So, I've been following a top down tutorial on youtube from a guy named BliskenX. (Excellent indepth tutorial for beginners btw.) I'm at the point where I shoot a bullet at the enemy. The problem? The bullet re-appears or re-spawns once it leaves the view port and comes back at the player even it hits the enemy. I implemented destroy bullet off screen behavior but that didn't seem to work. And a unrelated problem I'm having the editor asks me if I want to create a true?false hiarchy (in several other instances as well) when I don't put in or ask for that option.

    Thanks (I included a screenshot of the eventsheet.)

    Mike

  • I don't see any problems with events on the screenshot.

    Does the bullet reappear from another side of the screen? You didn't add Wrap behavior to it by any chance?

    If you can't figure it out, please post your project file.

    And a unrelated problem I'm having the editor asks me if I want to create a true?false hiarchy (in several other instances as well) when I don't put in or ask for that option.

    I don't know what you mean by this. Can you make a screenshot when this happens?

  • Hello.

    The bullet does reappear from the opposite side of the screen. There are no behaviors added to the bullet at all. I even tried destroy bullet off screen and that didn't work either. 😡

    I'll have to get to the other problem later.

  • I actually don't see any code that states the bullet is destroyed off screen. Just the line that says it will destroy if it hits Enemy01. Do you have it somewhere else not visible in this screenshot?

  • I erased that code when it didn't work

  • It needs to be there. Even if it did have the wrap property, destroying it off layer will prevent it from wrapping. If off layout doesn't work for you, try is not visible and see how that does. There's a few options for destroying it. If all else fails, wrap your layout in sprites that exist outside of the viewable layout, and have it destroy when it collides with them.

  • Pea

    Thank you so much for your helpful reply. I will work on this in the morning when I wake up. (My day job burnt me out.) Your time and advice is sincerely appreciated.

    🙏 Mike

  • Maybe you also left a bullet instance just outside of the layout in the editor.

    Run the project in debug mode (Shift+F4) and check all bullet instances.

  • The tutorial tells you to put the bullet outside of the view port. Are you saying think that is causing the Problem?

  • Well, maybe that is the bullet you see.

    A common solution is to create a separate unused layout as a repository for sprites, and move that bullet instance there.

  • I finally had some free time to look at the project and after much fiddeling the "set angle" button was ticked under the object properties bar and that was causing the problem.

    Thank you everyone for all your help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello.

    The bullet does reappear from the opposite side of the screen. There are no behaviors added to the bullet at all. I even tried destroy bullet off screen and that didn't work either. 😡

    I'll have to get to the other problem later.

    Hopefully this works. I linked a zip file to this post. Let know if you have problems opening it.

    https://drive.google.com/file/d/1T6ih-aIdIwOUDDH_jKt7ADV1Q1SMRfNI/view?usp=sharing

  • The file was exported as a Windows(WebView2) file if that helps. You mentioned posting the project profile. I don't know how to do that. Sorry.

    When I took off the set angle function there was no ricochet effect. But the bullet wouldn't do towards the enemy either.

  • Exporting as a WebView2 (or any of the export functions) doesn't allow anyone to edit it easily. What they are looking for is the .c3p file, which allows them to open it in construct, view the code, and make revisions/suggestions for you. You'll find that whereever the project is being saved.

  • Thank you for that information. Try this link. It should contain the c3p.file

    https://drive.google.com/file/d/105ibGhK9xMItuBrY0jBNJYotRrgjEKgp/view?usp=share_link

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