Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi I want to dynamically enable some of the behaviors of a node and deactivate some without deleting the behaviors. |
||||
|
You can of course use variables that check for a certain figure every time the behavior runs but even better is to use Actions that only run when needed then stop - more efficient this way. You can convert many behaviors into Actions that just do a certain thing. Things like keyboard/mouse inputs should be left as a behavior to check all the time though. |
||||
|
Thank you dear Robo For example, I want to give "2d simple jump and run" behavior to a node that has different speeds in different situations. I have to set several "2d simple jump..." behaviors at different speeds, each of which can be activated or deactivated as needed. Is such a thing possible? |
||||
|
You wouldn't want to activate different behaviors when you can just edit and keep just the one running only. in the extension you mentioned - if its from my download link then add this to lines 50 & 51: var speed = ccbGetCopperCubeVariable("speed"); this.speed = speed; then delete line 8 - if the speed you want to change is that figure only and not the jump speed. then create your own coppercube variable called "speed". Have this to have a default value before starting and then you just change this variable as needed....it will check each time for an updated speed value. |
||||
|
https://www.ambiera.com/forum.php?t=8692 |
||||
|
Tanks a lot again. This is a great method that solves many of my problems. Is this method useful for all extensions and plugins? Wherever I want to change the extensions variables, can I use this method? |
|