How do I fix the cursor not grabbing an item?

0 favourites
  • 3 posts
From the Asset Store
Mouse cursor is something that the player controls and sees all the time, that's why it is so important to make it cool!
  • Hi again,

    I want the cursor to "grab" an item in my inventory, but I can't seem to do that.

    I have the code, but it does nothing. Debugging reveals that when I click on the object, it says that the inspected item is destroyed when it's not destroyed. Which makes me think it's destroying and creating on the same frame.

    I don't know if this is the right topic to post this question in.

    Thanks!

    -Turtle11t

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have the code, but it does nothing. Debugging reveals that when I click on the object, it says that the inspected item is destroyed when it's not destroyed. Which makes me think it's destroying and creating on the same frame.

    That's probably what happens.

    In addition to Debug Mode, use browser logging.

    Add "Browser Log" action to the event where items are created and destroyed. In preview press F12 and open console - you will see how often they are created/destroyed.

  • I found the issue - my grabbing and releasing code is executing at the same time, so I needed to add a boolean to tell the code to not execute at the same time (tell me if I'm confusing you).

    Thanks for trying to help me.

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