I made an event so when the cursor touch is on an object it modifies a text.
i have multiple layers that have multiple objects that modify the same text object but the problem is if a layer is hidden it still reacts to the Cursor/touch object and modifies the text.
Any idea how can i disable the cursor touch event on a hidden layer?
There should be condition to check if layer is hidden (or maybe it was if layer is visible)
You could use that in event where you allow for text to change and set it so that if it is hidden it changes to something
Never use Of all of these conditions are true if it is not inside if one of these conditions is true
For example it it should be used like on screenshot below
In your 1st condition you add trigger once in condition and now you need to add action to change text
Next your 2nd event should not be sub event so move it to the left and add trigger once to condition while in action add change text and put in text field this “”
Which will make it display nothing
Thing is when you change text of object it does not revert back to anything if you do not set up it that way
Like imagine you have idle animation and walk animation on player
It won’t switch from idle to walk and then back to idle if you stop walking
Unless you set up to change animation to walk when player is moving
AND change animation to idle when player is not moving
You explained it so well lol it was great thank you so much, but i am still stuck on one problem (THE CURSOR/TOUCH IS AN OBJECT) is still showing the names of object from the previous layers (the layer that is hidden)
Looking at your screenshot from post where you reply to Keith
1 - you are using if one of these conditions is true
Well then if layer is not visible or if cursor or touch is on inventoryindicator
Then it will display text from 1st action
2 - in 2nd condition you have if cursor or touch is NOT on inventoryindicator
But if layer inventory crop is not visible then it will still display text from 1st event action
You should have one event where ONLY conditions you have are
REMOVE if one of these is true
cursor is on inventoryindicator
inventory crop is visible (or not visible if that is what you need)
And 2nd event condition then should be perfectly fine to remove text
You can add trigger once and then a list of conditions to clear the text but by then all of the extra conditions are going to use more process time then they save by preventing 1 action.
When i removed the if one of these conditions is true then it stopped working but i did the event as Keith said and it is working. Thank you for your help
Yes it is working just as i wanted thank you very much but a new problem has appeared and that is that some of the animation’s name is getting captured by the cursor touch but some of them don’t, even though they are on visible layer and their collision box is big enough.
Can you post how you’re using the events. Maybe a little before and a little after? Just for context. How about a screenshot or description of the scene in action so we can get a little more idea of what you are making.
And the inventory buttons event just switches back and forth between layers.
So if you click button 1 it hides all the other layers 2,3,4, etc then if you click button 2 it hides layer 1,3,4 etc
all those different layers have the object/sprite (Inventory Indicator) with different animations and names and there is one single text object on each layer which shows the names of the animations upon touch
and then below that is the event you told me
I hope that explains what i am doing.
And now when you click on tree it will display text of which layer is currently visible but only if cursor is on tree
If you move cursor away from tree text will disappear
But if you move it back on tree it will show current layer text
OK, I think I understand what’s happening, although I’m not sure I agree with it. There’s something with the layer is visible. I don’t think it works with instances without being in a for each object I’m not saying it’s broken, it’s just how it works.
My solution is to set the active layer to a string like activeLayer when you press an inventory button and compare it to the sprites layer.
The code for my test project. I assigned an id variable from 1 to 3 for the objects. It’s just quicker for me to do in testing. I might not actually use that but it’s quick and easy for testing.