ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperLicht
programmatically activate behaivour "Object or Person controlled by keyboard"
Author Text

jjoe64
Registered User
Quote
2012-10-19 15:59:34

Hi

is there a way to enable and disable the behaivor from CopperCube "Game Behaivour > Object or Person controlled by keyboard" programmatically from CopperLicht?

thx


niko
Moderator
Quote
2012-10-21 07:53:37

Yes, you could simply temporarily remove it from your scene node, like this:

var animator = yourSceneNode.getAnimatorOfType('keyboardcontrolled');
// store the animator for later adding it again somehow
yourSceneNode.removeAnimator(animator);


If you want it to work again, add it with addAnimator() again. I haven't tried it out, but it should work.


jjoe64
Registered User
Quote
2012-10-23 07:30:28

Many thanks, this works for me.

But one question just for understanding:
Why is this nowhere explained in the documentation (API). Shouldn't there be a class "CL3D.AnimatorKeyboardControlled"? Or comes this animator from the CopperCube export and thus cannot be created directly from CopperLicht?


niko
Moderator
Quote
2012-10-24 08:01:10

It's because it's a CopperCube internal animator, and not intended to be used without it. It will probably be changed in the future, so if you want to create your own animator which does things like that, don't base it on this animator. That's why it's not documented.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Forum 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


   





Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.