Hello, all! I’m trying to create a simple card game where the player can draw cards and use one by clicking on it every turn. I’m trying to accomplish this with a card object that holds card data and a custom class that extends the Sprite class, which has a card data field, and having that be interactable. Code for the custom VisualCard class is here:
However, when I run the project and click on VisualCard object, nothing is output to the console, which seems to indicate that its not interactable. Testing this with pointerover seems to confirm this. What am I doing wrong here? Any help is greatly appreciated!
Ok I added that and that is being printed to the console for every scene on scene creation. Something I should mention is that inputs (mouse and keyboard) were working in other parts of the project.
It is only printing when clicked. I actually figured out the issue. This is a group project and one of my teammates put something in the update() of the relevant scene that printed something to console constantly which made it so that I couldn’t see anything else. Things from scenes before I could see, but not in that one. Thank you for your help! Unfortunately, now I’m encountering another problem. I’m trying to make it so that VisualCards change their tint to 0x00ff00 when the mouse is over them and clear the tint when its not. The code for that is:
Now I know that interaction with the mouse is working, but this isn’t. I even have the same code elsewhere for a different sprite in the same scene and it works perfectly fine. Any help with this is very appreciated!
Thank you for your help! I’ve actually figured out the issue; there’s a function that’s used to display the cards a player has drawn and one of my teammates put that function in the update function and the same function is also associated with the function for drawing cards. This created two copies of all the cards and, for some reason, the top copies didn’t work. Commenting out the update() occurrence of the function allows it to work properly. Again, thank you so much for your help and time!