≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
scripted rotation
Posted by:
(you are not logged in)
Enter the missing letter in: "Intern?tional"
(you are not logged in)
Text:
[quote][b][/b] wrote: [quote][b]nigec[/b] wrote: I'm trying to make a combination lock, four numbered cylinders that rotate when clicked I can do it with with "change rotation of scene node" then "rotate by rotation" but I can't see how to do this using a script [code]ccbSetSceneNodeProperty(currentNode, "Rotation",36.0,0.0,0.0 );[/code] just turns it the first 36 degrees, I can't figure out how to add rotate by rotation It seems easy enough to do without the script with a few variables checking turn count etc where's the fun in that *grin* It would be nice to do my own action were I could enter a combination code and generally learn...I'm new to js and Coppercube[/quote] If you set it 36 then it will be 36.. it doesnt ADD 36 but sets it to be fixed 36. to ADD 36 use this.. var OldRot=ccbGetSceneNodeProperty(currentNode, "Rotation"); var NewRot=OldRot.x +36; ccbSetSceneNodeProperty(currentNode, "Rotation", NewRot,0,0 ); OR use variable.. variable Xrot=36; Xrot+=36; ccbSetSceneNodeProperty(currentNode, "Rotation",Xrot,0.0,0.0 ); If you didnt understand then feel free to ask again.. i make example if you need it.[/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