Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Can't Use "Key Pressed Down" for Toggling Between Two Different Actions

sebastianos
Registered User
Quote
2019-06-02 10:21:54

I have done tests to prove this and you can too. Guys, these issues are NOT GOOD and someone needs to address this. Please take the time to carefully read this.

Alright, so let's use Escape as an example key. And this behavior is tied to the scene, NOT to any objects or overlays.

Situation One
So when Escape "Key Pressed Down", if Box (variable) equals 1, make 2D Overlay1 invisible and 2D Overlay2 visible and set Box to equal 2.

Situation Two
Now when Escape "Key Pressed Down", if Box (variable) equals 2, make 2D Overlay2 invisible and 2D Overlay1 visible and set Box to equal 1.

So the result should be that you can switch back and forth between making the 2 overlays visible and invisible. But IT DOESN'T WORK!! Why? Because CopperCube has this ridiculous issue where just pressing the Escape key once will change the variables of both situations before anything is made visible or invisible. It's like, it reads situation one where Box equals 1 and changes the variable Box to equal 2 and then since Escape is still pressed down, it reads the situation two and now that Box equals 2, it makes variable Box equal 1..... all before getting to making things visible or invisible. At least, that's one of my theories. I don't really know. OR, maybe it's reading situation one, changing the variable AND making one box visible and the other invisible, then since the Escape is still pressed down, it then reads situation two and changes the variable AND makes one box visible and the other invisible. Perhaps both situations are happening so fast that you can't see it or the computer can't keep up fast enough to show it, or maybe it's so fast that it's not even told to draw these things at all on the screen! I don't know, but that's my other theory.

Either way, I think the issue has to do with the fact that the Escape key is pressed down and some or all of both situations are being read at the same time because the Escape key is pressed down for both. Is this a bug with CopperCube? Or is this expected and I should find a different way to accomplish this?

Alternative Method

Since this method of making the two overlays appear and disappear doesn't work, there is an alternative that works once and then stops working after the first try. And these two behaviors are NOT tied to the scene itself, rather they are tied to two different overlays.

For 2D Overlay1, when Escape is pressed, make 2D Overlay1 invisible and 2D Overlay2 visible.

For 2D Overlay2, when Escape is pressed, make 2D Overlay2 invisible and 2D Overlay1 visible.

Note: Just make sure that one of them starts off invisible in the beginning but the other is still visible.

This method works because the actions work when Escape is pressed ONLY when one of each overlay is visible. If an overlay is not visible, Escape doesn't work. So this conveniently allows you to make one overlay visible and the other invisible and vice versa. It's a simpler and different way of accomplishing what I was trying to do earlier.

But here's the problem.

After pressing Escape two times, it's stops working. So basically, press Escape, 2D Overlay1 disappears (if that's the only overlay you had visible in the beginning) and 2D Overlay2 appears. Press Escape again, 2D Overlay2 disappears and 2D Overlay1 appears. Now, when you press Escape a third time, nothing changes. Nothing that was previously visible becomes invisible and nothing that was previously invisible becomes visible. It stops working. Why??? I don't know!!!

Why does CopperCube make it so difficult to toggle the visibility of two different overlays? I don't know what to do anymore! Please help, thanks!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact