ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator Change Attributes of Behaviors at runtime?
person icon
drnibbert
Registered User
Quote
2026-03-06 14:34:19

Hello :-)

Is it possible to change the attributes of a Behavior at runtime?

For example: When Player enters area -> enable CanFly on PlayerController?

Thanks a lot! :-)

person icon
nazrin6
Registered User
Quote
2026-03-06 16:46:04

I've tried to do this in the past and I don't think you can. I think you'll just have to use 2 cameras.

person icon
drnibbert
Registered User
Quote
2026-03-07 08:28:29

Thanks for the idea!

In this example i try to use the middle block as ladder. (FPS-Controller)

Can you give advice on how to make the transition between the 2 cameras smoother?

www.nhx-music.de/stuff/ccb_LadderTest_03.ccb

Thanks!

person icon
Monks
Guest
Quote
2026-03-08 18:58:39

Got you covered
https://5v3n.itch.io/coppercube-...

This will solve your need

person icon
drnibbert
Registered User
Quote
2026-03-10 11:17:59

Sweet, thanks a lot for the ladder-skript! That solves that :-)


Can you give any advice on how to smoothly switch between Cameras with Character-Controller (to cover any other usecase besides ladders :-) )

Thanks a lot!

person icon
Monks
Guest
Quote
2026-03-11 12:22:33

Welll, this does that
https://zeicmann.itch.io/copperc...
You can try out the ccb files that comes with it and see

person icon
drnibbert
Registered User
Quote
2026-03-12 13:10:07

Cool collection, thanks for the tip!

person icon
gazzauk
Registered User
Quote
2026-04-12 04:00:55

You can change variables, attributes and properties using the basic functions:
ccbSetCopperCubeVariable(varname, value)
ccbGetCopperCubeVariable(varname)
ccbGetSceneNodeProperty(sceneNode, propertyName)
ccbSetSceneNodeProperty(sceneNode, propertyName, value)

person icon
drnibbert
Registered User
Quote
2026-04-15 18:38:40

Thanks :-) But can i access properties of Behaviors with this?
for example enable/disable "Affected by Gravity" on the "Collide when moved"-Behavior at runtime?

wrote:
You can change variables, attributes and properties using the basic functions:
ccbSetCopperCubeVariable(varname, value)
ccbGetCopperCubeVariable(varname)
ccbGetSceneNodeProperty(sceneNode, propertyName)
ccbSetSceneNodeProperty(sceneNode, propertyName, value)


person icon
gazzauk
Registered User
Quote
2026-04-15 20:24:40

Possibly yes, with a custom binary but I normally write my own behaviours so have full access to all its properties.

You can try using ccbSetPhysicsVelocity(sceneNode, x, y, z)
for some control over physics.

person icon
nilefox
Guest
Quote
2026-04-15 20:43:47

Hi gazzauk, what you saidsounds interesting(concerning you write your own behaviours), have you developed any game?emoji icon_smile

person icon
gazzauk
Registered User
Quote
2026-04-15 20:53:22

nilefox wrote:
Hi gazzauk, what you saidsounds interesting(concerning you write your own behaviours), have you developed any game?emoji icon_smile


As I understand it, the default in-built behaviors can easily be replicated in javascript, they are just quick and easy to use for non-coders.

I develop mostly applications and not many games. I recently started to use CopperCube for R&D and prototyping projects that are then implemented for personal and educational use.

If I'd had known about CC years ago then I'd have used it much sooner as it's a breeze to work in and get simple projects up and running in minutes.

person icon
nilefox
Guest
Quote
2026-04-16 15:35:57

That's interesting, I'm not much of a coder, it's nice to see someone who has in depth knowledge on such stuff

person icon
gazzauk
Registered User
Quote
2026-04-16 23:35:55

nilefox wrote:
That's interesting, I'm not much of a coder, it's nice to see someone who has in depth knowledge on such stuff


My in-depth knowledge is not so much in coppercube but programming languages in general.

I can code very well but I'm a terrible games maker, so I stick to what I'm good at and rely heavily on other people with the design skills do their thing :)

person icon
nilefox
Guest
Quote
2026-04-17 10:12:41

Ahh, I see, are you on Discord or is there any way I can reach you?


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 |