≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
a new action.
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b]carlosm[/b] wrote: Hello everyone, *smile* I am trying to offset an object with an action I did. but he simply jumps from where he should go. I didn't do a behavior so I didn't use the "onAnimate" prototype. but an action would like a tip on how to smoothly move the object from point A to point B. The code I used was this: [code] delta var = 200; var speed = 0.02; var player1 = ccbGetSceneNodeFromName ("player_1"); var pos_1 = ccbGetSceneNodeProperty (player1, "Position"); var mob1 = ccbGetSceneNodeFromName ("Mob_1"); var pos_mob = ccbGetSceneNodeProperty (mob1, "Position"); var move_Vector = pos_1.substract (this.pos_mob); print (move_Vector); // move_Vector.normalize (); Â Â this.pos_mob.x + = move_Vector.x * delta * speed; Â Â this.pos_mob.y + = move_Vector.y * delta * speed; Â Â this.pos_mob.z + = move_Vector.z * delta * speed; Â // set new position ccbSetSceneNodeProperty (mob1, 'Position', this.pos_mob);[/code] [b] The scene is this: When the player approaches him He changes his animation, and goes in the direction of the player. but it simply jumps to the location of the player I want to move in a vector like behavior that has coppercube itself. Else I used javascritp's native function and the editor as undeclared function! We don't have access to javascript api? if anyone helps or gives a tip thanks.[/b][/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