Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Some problems with coding

dekon_17
Registered User
Quote
2021-06-20 12:02:34

Well, now I am asking a questions here. So, I tried to script some stuff, but I got in three problems (by now probably):

-My code makes character "slide" (not actually) only in a fixed direction, and not the one were I am looking at.

-I don't really know how to make a real slide, not a teleportation (by that, I mean that the character does a simple repositioning, duh...).

-I... I don't know how to make character slide only on a ground (without a "sliding to the sky", as it was with "Move Scene Node" action)

And so, if there wasn't a source code, I wouldn't left this thread here, you know. So, here it is:

<action jsname="action_BSGslide" description="BSG slide">
<property name="Object" type="scenenode" />
<property name="Time" type="int" default="1000" />
<property name="Distance" type="vect3d" default="40.0, 0.0, 0.0" />
</action>

action_BSGslide = function()
{
};

action_BSGslide.prototype.execute = function(currentNode)
{
var oldPos = ccbGetSceneNodeProperty(this.Object, "Position");
var newPos = oldPos.add(this.Distance);
ccbSetSceneNodeProperty(this.Object, "Position", newPos)
}


As you can see, there is a "Time" property, but I didn't used it since I don't know how.
So-o... Can someone... Help, I guess?


RadioShack
Guest
Quote
2021-07-02 15:38:53

if object is static mesh then
there must be more behaviors attached to it and they cause the animated sliding otherwise movement would have bee a floup.

if object is a animated mesh these settings influence your fluent sliding:

- looping
- framespersecond
- animation
- animationblending !!!
- blendtimems


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

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