How do I change opacity of object UID?

0 favourites
  • 7 posts
From the Asset Store
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • Hi,

    I have several same type objects. I want to change the opacity of just one of them.

    I was thinking about the UID of the objects but I can't figure it out the expresion for it.

    Something like this:

    On SpriteX collision with SpriteY then Change Opacity of SpriteZ UID=10 to 100



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Giving the object an instance variable and only changing the one with that variable would work..

  • How do i change just one?

    I've tried but all objects changes.

    I've attached my events

  • Are you trying to do something like this ? ... ickup.capx

  • edit: ok after looking back over your original question....

    Your screen shot works the way you have it setup, i got confused with there being 2 different Heart shaped sprites with different names in there.

    If you want to use the UID method you can, you just need to add the "picking" of the UID in a separate action line in order to target it as the one you want to change its opacity of.

    eg: On Sprite X Collision with SpriteY ->

    (sub event) SpriteZ.UID = (which ever UID you want to target) -> set opacity to 100

    By adding the "spriteZ.UID =" to a new sub event, you are telling which object for construct to find an make actions to.

    The more confusing part though is the way you might be going about trying to find an object to change its value of.

    Normally you would want to save the UID of the object you collided with , not the UID of a completely different object (SpriteZ).

    If sprite Z is just a healhbar or or something, then simply refer to it directly instead.

    eg: On Sprite X collision with Sprite Y -> add 1 to hearthbar

    You seem to be trying to change opacity of random other objects instead of one specific one.

  • Thanks for the help!! It works!

    I wanted to do exactly as the .capx from Magistross.


  • Praised be my insightfulness !

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