How do I pick only one instance of a sprite to which I load a canvas image?

0 favourites
  • 3 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • I am trying to pick an instance of a sprite. To said sprite I want to load the image from a canvas object using Load Image From URL: DrawingCanvas.SavedImageURL. However, I noticed that using the pick conditions doesn't seem to work for the Load Image From URL action.

    For example, when I pick by IID, if the IID exists then all the sprites will be picked. If the IID doesn't exist none of them are picked. My question is why is it that all of the sprites are picked when only the one with the set IID should be picked?

    What I am eventually trying to achieve, is that I have multiple canvases which each have a corresponding sprite. Each canvas will be loaded to their corresponding sprite without interfering with the others.

    Thank you in advance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For example, when I pick by IID, if the IID exists then all the sprites will be picked.

    I believe the problem is not with picking. When you load an image into a sprite, all sprite instances receive the same image. If you want to load different images to different instances, you have to use multiple animation frames. Say, if you have 10 sprites, create 10 empty frames and set a different frame for each instance.

    By the way, if you want to pair each canvas with a sprite instance, you can add them to a container. This will simplify picking, creating and destroying.

  • Thank you!

    After little experimentation it seems that the canvas will be loaded to the frame that the first instance of the sprite is currently playing. So by changing the frame in the first instance and one select instance picked from the sprites I can add a specific canvas Image to a specific sprite.

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