ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Variable to block inputs?
person icon
ryandavanzo
Registered User
Quote
2025-02-28 22:05:42

Is there a way to do make an variable that disabels mouse and keyboard inputs for an few seconds without an javascript? idk why but coppercube just outright refuses to even print "hello world" using java lol

sooo...is there a way to do it with variables?

person icon
guest_guest
Guest
Quote
2025-02-28 22:29:35

are you using javascript and not java?

print("Hello, World!");

that will print to the console.

umm i'd use code to do what you want, but i guess the easiest way would be for you to put all your input behaviors under a folder node and then hide the folder node so the behaviors don't work for however long you need then set them visible again. note you need the behavior to turn on/off the visibility to be outside the folder node for it to work, i guess

person icon
okeoke
Registered User
Quote
2025-03-01 08:45:35

Short answer is "no". It's not possible to disable inputs for built-in behaviors at all.

Though, you can attempt to workaround it using ccbEmulateKey. I haven't tried it, but I think it will not work - input for 1 frame still will be read by those behaviors.

If you're using a built-in 3rd person controller, I would rewrite it in js, and add a possibility to switch all logic off using a variable like:
onAnimate() {
if (ccbGetCoppercubeVariable('isInputAvailable') === '1') return;
}


If you're using fps camera, you can switch to a simple camera which doesn't read any user input.

You can also use ccbSetMousePos to set mouse cursor position in the middle of the screen.

All of that requires some trial and error, and might work or not work based on your specific situation.

person icon
serge
Registered User
Quote
2025-03-01 10:39:19

Sound like he trying do a freeze camera?

If it's a freeze camera, then create a cube with a proximity. In action set change position, fixed poistion to camera, do something later after ms 3000 delete scene node cube. When the character walks on proxi then the camera freeze. Or write a Javascript for camera with fixed position target node and camera.

https://samgrady.itch.io/copperc...


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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