≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Walk and Stand animation by key
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b]tim12345[/b] wrote: if you still want to use behavior script... something like this might work for you probably... [code]/* <behavior jsname="behavior_LegsAnimation" description="LegsAnimation"> <property name="Object" type="scenenode" /> </behavior> */ behavior_LegsAnimation = function() { this.WKeyDown = false; }; behavior_LegsAnimation.prototype.onAnimate = function(node) { if (this.WKeyDown){ ccbSetSceneNodeProperty(this.Object, 'Animation', "walk"); ccbSetSceneNodeProperty(this.Object, 'Looping', true); } else ccbSetSceneNodeProperty(this.Object, 'Animation', "stand"); ccbSetSceneNodeProperty(this.Object, 'Looping', true); } behavior_LegsAnimation.prototype.onKeyEvent = function(key, pressed) { if (key == 87) this.WKeyDown = pressed; } [/code][/quote]
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
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact