ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator Modifying a behaviour's property on a keypress
person icon
johngamemaker
Registered User
Quote
2025-08-24 23:52:37

I want to make it so that the speed to slow down from walking and from running is different.

To achieve this, I created a first person camera. I want to make it so that pressing shift changes the "MsToSlowDown" value from the first person camera behaviour to a higher one and releasing it sets it to a default value.

I have tried the following two snippets of code through the "Execute Java Script" action after looking through some examples on the forum and through documentation:
 ccbSetCopperCubeVariable("Player.MsToSlowDown", 700)
and
var s = ccbGetSceneNodeFromName("Player");
ccbSetSceneNodeProperty(s,"MsToSlowDown", 700);

neither of which seem to work.

What would be the correct syntax to change a property of a behaviour? Or is that simply not possible?

person icon
guest_Des
Guest
Quote
2025-08-25 01:53:46

To get this working, do not use script, rather use set variable action and use player.movementspeed as variable and set the value to the speed you want the word 'player' should be replaced with the name of your character for example if he's called man, it should be man.movementspeed

Oh snap, if you mean the MsToSlowDown parameter in fps camera behavour then i dont think that is configurable


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 |